Bug 6272 – Named import in functions problem

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2011-07-08T17:41:00Z
Last change time
2012-01-20T09:45:21Z
Keywords
rejects-valid
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2011-07-08T17:41:27Z
This compiles correctly (DMD 2.054 beta): import std.string: join; void main() { string[] a = ["foo", "bar"]; string s = join(a); } This too: void main() { import std.string; string[] a = ["foo", "bar"]; string s = join(a); } But this: void main() { import std.string: join; string[] a = ["foo", "bar"]; string s = join(a); } gives: temp.d(4): Error: undefined identifier join, did you mean function main?
Comment #1 by dsimcha — 2011-08-10T20:44:07Z
*** Issue 6465 has been marked as a duplicate of this issue. ***
Comment #2 by bearophile_hugs — 2011-11-23T09:35:47Z
*** Issue 6991 has been marked as a duplicate of this issue. ***
Comment #3 by kamm-removethis — 2011-11-23T09:57:28Z
Comment #4 by bearophile_hugs — 2011-11-25T16:27:19Z
This seems a related problem: void main() { import std.algorithm; auto data = new int[10]; sort(data); // OK data.sort(); // Error: undefined identifier module temp.sort }
Comment #5 by code — 2012-01-20T09:45:21Z