D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 21481 - functions in overloaded template are lost when the template overloads an alias
Summary: functions in overloaded template are lost when the template overloads an alias
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
Depends on:
Blocks:
 
Reported: 2020-12-14 00:26 UTC by kdevel
Modified: 2021-01-04 02:19 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 kdevel 2020-12-14 00:26:10 UTC
from http://forum.dlang.org/thread/lhnvvkylevyuwotygjol@forum.dlang.org

~~~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 Dlang Bot 2021-01-03 06:40:47 UTC
@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 Dlang Bot 2021-01-04 02:19:05 UTC
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