Bug 7344 – Function-as-array-method doesn't work with local imports
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2012-01-21T19:04:00Z
Last change time
2012-01-21T19:41:29Z
Keywords
rejects-valid
Assigned to
nobody
Creator
bearophile_hugs
Comments
Comment #0 by bearophile_hugs — 2012-01-21T19:04:59Z
This is a spinoff of bug 6272, that was not fully fixed.
void main() {
import std.algorithm;
auto data = new int[10];
sort(data); // OK
data.sort(); // line 5, Error
}
The latest DMD 2.058head gives:
test.d(5): Error: undefined identifier module test.sort
This version gives the same error:
void main() {
import std.algorithm: sort;
auto data = new int[10];
sort(data); // OK
data.sort(); // line 5, Error
}
Comment #1 by andrej.mitrovich — 2012-01-21T19:30:25Z
Dup of Issue 6185?
Comment #2 by bearophile_hugs — 2012-01-21T19:41:29Z
*** This issue has been marked as a duplicate of issue 6185 ***