Bug 5567 – arrays can't call aliased functions as member functions
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2011-02-12T15:50:00Z
Last change time
2015-06-09T01:31:19Z
Assigned to
nobody
Creator
issues.dlang
Comments
Comment #0 by issues.dlang — 2011-02-12T15:50:34Z
This program:
import std.range;
import std.stdio;
void main(string[] args)
{
alias empty e;
writeln(args.e);
}
fails to compile, giving this message:
test.d(8): Error: undefined identifier module test.e
It shouldn't matter whether an alias is used. The function should act the same way that it does when not aliased. And in this case, that fails, since you can't call it as if the function were a member function of the array, which you can normally do.
Comment #1 by yebblies — 2012-02-01T22:23:39Z
The problem is not the alias, but the fact the alias is not at global scope.
*** This issue has been marked as a duplicate of issue 4525 ***