Bug 23644 – Reordering template parameters causes IFTI to fail

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2023-01-20T21:10:31Z
Last change time
2024-12-13T19:26:47Z
Assigned to
No Owner
Creator
Paul Backus
Moved to GitHub: dmd#20215 →

Comments

Comment #0 by snarwin+bugzilla — 2023-01-20T21:10:31Z
As of DMD 2.101.2, the following program fails to compile: --- void f(U : T[], T)(U arg) {} void g(T, U : T[])(U arg) {} void main() { int[] a; f(a); // ok g(a); // IFTI fails } --- The error messsage is --- bug.d(9): Error: none of the overloads of template `bug.g` are callable using argument types `!()(int[])` bug.d(2): Candidate is: `g(T, U : T[])(U arg)` --- The only difference between `f` and `g` is the order in which their template parameters are listed, yet the call to `f` succeeds, while the call to `g` fails to compile.
Comment #1 by robert.schadek — 2024-12-13T19:26:47Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20215 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB