D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 5567 - arrays can't call aliased functions as member functions
Summary: arrays can't call aliased functions as member functions
Status: RESOLVED DUPLICATE of issue 4525
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Linux
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-12 15:50 UTC by Jonathan M Davis
Modified: 2015-06-09 01:31 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Jonathan M Davis 2011-02-12 15:50:34 UTC
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 yebblies 2012-02-01 22:23:39 UTC
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 ***