[Issue 18389] New: Missing interference for nested static arrays
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Feb 7 12:55:59 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=18389
Issue ID: 18389
Summary: Missing interference for nested static arrays
Product: D
Version: D2
Hardware: x86
OS: Windows
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: simen.kjaras at gmail.com
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
--
More information about the Digitalmars-d-bugs
mailing list