Bug 4945 – Bad error message with wrong struct literal

Status
RESOLVED
Resolution
DUPLICATE
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2010-09-26T10:36:00Z
Last change time
2015-12-09T12:23:08Z
Keywords
diagnostic
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2010-09-26T10:36:03Z
struct Foo(int N) { int[N] bar; } void main() { auto r = Foo!(1)([1, 2]); } DMD 2.049 shows: test.d(5): Error: cannot implicitly convert expression ([1,2]) of type int[] to int But I think there are no int types here, just an int array of the wrong length.
Comment #1 by lt.infiltrator — 2015-12-09T09:53:09Z
dmd 2.069 shows the error as Error: cannot implicitly convert expression ([1, 2]) of type int[] to int[1] Would you call this fixed?
Comment #2 by k.hara.pg — 2015-12-09T12:23:08Z
*** This issue has been marked as a duplicate of issue 8892 ***