Bug 21257 – Template overload created by named imports passed via template alias to function in other module can't be instantiated

Status
NEW
Severity
minor
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2020-09-16T14:58:02Z
Last change time
2024-12-13T19:11:35Z
Assigned to
No Owner
Creator
FeepingCreature
Moved to GitHub: dmd#19789 →

Comments

Comment #0 by default_357-line — 2020-09-16T14:58:02Z
Consider the following two files: ``` --- test2.d void act1(T : void)() { } void act2(T : int)() { } void call(alias fn, T)() { alias instance = fn!T(); instance(); // this works fn!T(); // this does not! } --- test.d import test2 : act = act1, act = act2, call; void main() { act!int(); // this works act!void(); // this works, so act is an overload set call!(act, void); // but not this? call!(act, int); // and not this either! } ``` https://run.dlang.io/is/gxaPuX Even though we can call `act` in test with both supported types, we cannot call it in `test2` with either. We get the error "none of the overloads of `act` are callable using argument types `!(Struct)()` or "`!(int)()` respectively. If the function is aliased beforehand, it works.
Comment #1 by robert.schadek — 2024-12-13T19:11:35Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19789 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB