Bug 18389 – Missing inference for nested static arrays

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2018-02-07T12:55:59Z
Last change time
2024-12-13T18:56:51Z
Assigned to
No Owner
Creator
Simen Kjaeraas
Moved to GitHub: dmd#19383 →

Comments

Comment #0 by simen.kjaras — 2018-02-07T12:55:59Z
The example below is expected to compile: void foo(T, size_t a, size_t b)(T[a][b] value) {} foo([ [1,2], [3,4] ]); // T should be int, a = 2, b = 2. Instead: compile error. It works when the type of value is known, and when foo isn't a template (which is just a special case): foo!(int,2,2)([[1,2],[3,4]]); But not if any part of the type is missing: foo!(int, 1)([[1]]); foo!(1,1)([[1]]); // Move T in the argument list
Comment #1 by robert.schadek — 2024-12-13T18:56:51Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19383 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB