Bug 24804 – IFTI fails for variadic static array parameter with narrowing conversion on templated length

Status
NEW
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2024-10-10T18:04:59Z
Last change time
2024-12-13T19:38:00Z
Assigned to
No Owner
Creator
Paul Backus
Moved to GitHub: dmd#20529 →

Comments

Comment #0 by snarwin+bugzilla — 2024-10-10T18:04:59Z
As of DMD 2.109.1, the following program fails to compile: --- void test(ubyte n)(int[n] a...) {} void main() { test(1, 2, 3); // error } --- The error message is: --- bug.d(5): Error: template `test` is not callable using argument types `!()(int, int, int)` bug.d(1): Candidate is: `test(ubyte n)(int[n] a...)` --- Any of the following changes cause the program to compile successfully: - Changing the call site to `test([1, 2, 3])` - Changing the call site to `test!3(1, 2, 3)` - Changing the template parameter of `test` to `size_t n`
Comment #1 by robert.schadek — 2024-12-13T19:38:00Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20529 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB