Bug 23281 – [REG2.099] Cannot pass alias template overload to template ("is not a template, it is a function")

Status
NEW
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-08-03T21:36:21Z
Last change time
2024-12-13T19:24:06Z
Keywords
industry, rejects-valid
Assigned to
No Owner
Creator
johanengelen
Moved to GitHub: dmd#20138 →

Comments

Comment #0 by johanengelen — 2022-08-03T21:36:21Z
Testcase: ``` struct S { void foo(int a) {} void foo_old(long a) {} alias foo(I: int) = foo_old; } void templ(alias IMPL)() { pragma(msg, typeof(IMPL)); } void foo() { S s; templ!(mixin("S.foo")); templ!(S.foo); // no new pragma output because same // template instantation as previous line templ!(mixin("S.foo!int")); //templ!(S.foo!int); // Error: example.S.foo is not a template, it is a function } ``` Compilation with dlang 2.098 or older outputs: ``` void(int a) void(long a) ``` Compilation with dlang 2.099 outputs: ``` void(int a) <source>(17): Error: `example.S.foo` is not a template, it is a function ``` The actual case in our case was more complicated and magically was fixed with dlang 2.099 after replacing `S` by `s` in `templ!(mixin("S.foo!int"));` (change of type --> variable)...
Comment #1 by johanengelen — 2022-08-03T21:40:13Z
Comment #2 by robert.schadek — 2024-12-13T19:24:06Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20138 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB