Bug 21481 – functions in overloaded template are lost when the template overloads an alias
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-12-14T00:26:10Z
Last change time
2021-01-04T02:19:05Z
Keywords
pull
Assigned to
No Owner
Creator
kdevel
Comments
Comment #0 by kdevel — 2020-12-14T00:26:10Z
from http://forum.dlang.org/thread/[email protected]
~~~A.d
module A;
import std.stdio;
void bar (int s) { __PRETTY_FUNCTION__.writeln; }
~~~
~~~foo.d
import std.stdio;
import A;
alias bar = A.bar;
version (X) {
void bar (T) (T t) { __PRETTY_FUNCTION__.writeln; }
}
void bar (int s) { __PRETTY_FUNCTION__.writeln; }
void main ()
{
bar (1);
}
~~~
$ dmd -i foo
foo.d(13): Error: foo.bar called with argument types (int) matches both:
A.d(4): A.bar(int s)
and:
foo.d(9): foo.bar(int s)
$ dmd -version=X -i foo
$ ./foo
void A.bar(int s)
Comment #1 by dlang-bot — 2021-01-03T06:40:47Z
@BorisCarvajal created dlang/dmd pull request #12092 "Fix Issue 21481 - functions in overloaded template are lost when the …" fixing this issue:
- Fix Issue 21481 - functions in overloaded template are lost when the template overloads an alias
https://github.com/dlang/dmd/pull/12092
Comment #2 by dlang-bot — 2021-01-04T02:19:05Z
dlang/dmd pull request #12092 "Fix Issue 21481 - functions in overloaded template are lost when the …" was merged into master:
- 518157506bc45bcd66b957f9330e0adc3d473be1 by Boris Carvajal:
Fix Issue 21481 - functions in overloaded template are lost when the template overloads an alias
https://github.com/dlang/dmd/pull/12092