D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 14858 - spurious "Error: overload alias 'foo' is not a variable" when overloading template and non-template via aliases
Summary: spurious "Error: overload alias 'foo' is not a variable" when overloading tem...
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords: pull, rejects-valid
: 15120 (view as issue list)
Depends on:
Blocks: 15311
  Show dependency treegraph
 
Reported: 2015-08-01 18:45 UTC by ag0aep6g
Modified: 2017-08-02 08:07 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 ag0aep6g 2015-08-01 18:45:15 UTC
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;
----
Comment 2 github-bugzilla 2015-09-15 12:05:31 UTC
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/803da8f10c0c5d09da5b19274ba1a1b9763d5e03
fix Issue 14858 - spurious "Error: overload alias 'foo' is not a variable" when overloading template and non-template via aliases

https://github.com/D-Programming-Language/dmd/commit/e91a6ac45b6adc2d8080df14caca0b62cad19a9b
Merge pull request #4857 from 9rnsr/fix14858

Issue 14858 - spurious "Error: overload alias 'foo' is not a variable" when overloading template and non-template via aliases
Comment 3 Kenji Hara 2015-09-27 00:31:38 UTC
*** Issue 15120 has been marked as a duplicate of this issue. ***
Comment 4 github-bugzilla 2017-08-02 08:07:22 UTC
Commit pushed to dmd-cxx at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/56edd1af4bddce6752105dafacac9653d9fe2cdb
Issue 14858 - spurious "Error: overload alias foo is not a variable" when overloading template and non-template via aliases