Bug 15890 – IFTI for static array argument length when element type supplied

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2016-04-07T11:46:02Z
Last change time
2024-12-13T18:47:23Z
Assigned to
No Owner
Creator
Nick Treleaven
Moved to GitHub: dmd#19113 →

Comments

Comment #0 by nick — 2016-04-07T11:46:02Z
dmd 2.070.2 doesn't always support inference of n, but not T, for a static array argument: T[n] staticArray(T, size_t n)(T[n] arr) { return arr; } unittest { immutable(int)[2] arr = [1,2]; // OK immutable(int)[2] isa = [1,2].staticArray!(immutable int); // cannot deduce int[2] sa = [1,2].staticArray!(int); // OK immutable(int)[2] isa2 = [1,2].staticArray!(immutable int, 2); // OK } (staticArray is from a Phobos PR: https://github.com/D-Programming-Language/phobos/pull/4090).
Comment #1 by robert.schadek — 2024-12-13T18:47:23Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19113 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB