[Issue 14858] New: spurious "Error: overload alias 'foo' is not a variable" when overloading template and non-template via aliases

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Aug 1 11:45:15 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=14858

          Issue ID: 14858
           Summary: spurious "Error: overload alias 'foo' is not a
                    variable" when overloading template and non-template
                    via aliases
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: ag0aep6g at gmail.com

Reported by vitus to D.learn:
http://forum.dlang.org/post/dhqqkndwgljtxnycziyo@forum.dlang.org

----
void foo()(){}
void bar(int){}

alias foobar = foo;
alias foobar = bar;

void main()
{
    foobar(1); /* Error: overload alias 'foo' is not a variable */
}
----

Works when when the call has a leading dot:
----
    .foobar(1);
----

Works when the order of the aliases is switched:
----
alias foobar = bar;
alias foobar = foo;
----

--


More information about the Digitalmars-d-bugs mailing list