Bug 9216 – Local import of std.array does not make popFront() visible
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-12-27T01:09:00Z
Last change time
2012-12-27T09:03:02Z
Assigned to
nobody
Creator
puneet
Comments
Comment #0 by puneet — 2012-12-27T01:09:52Z
test.d(6): Error: undefined identifier 'popFront'When I import std.array at module level (line 1), popFront is available. But if I import std.array inside the main function, it gives me an error saying:
test.d(6): Error: undefined identifier 'popFront'
// import std.array; // compiles fine when placed here // 1
void main() // 2
{ // 3
import std.array; // does not make popFront visible // 4
int foo[] = new int[5]; // 5
foo.popFront(); // 6
} // 7
Comment #1 by bearophile_hugs — 2012-12-27T01:12:44Z
This is known limitation of UCFS. If you import array inside a function, then you have to use its function with the normal function syntax:
popFront(foo);
I'd like this limitation to be solved, but I don't know of plans to solve it.
Comment #2 by andrej.mitrovich — 2012-12-27T09:03:02Z
*** This issue has been marked as a duplicate of issue 6185 ***