Bug 8918 – Wrong sized literal assigned to fixed size literal error message

Status
RESOLVED
Resolution
DUPLICATE
Severity
minor
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2012-10-30T10:58:00Z
Last change time
2012-11-29T14:49:22Z
Keywords
diagnostic
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2012-10-30T10:58:25Z
This is a spinoff of Issue 8893 struct Foo { char[3] data; } int bar(Foo f) { return f.data[0]; } void main() { enum f = Foo(['A', 'B']); enum int b = bar(f); } Expected error message: test.d(8): Error: cannot implicitly convert expression (['A','B']) of type char[] to char[3] But DMD 2.061alpha gives: test.d(8): Error: cannot implicitly convert expression (['A','B']) of type char[] to char
Comment #1 by andrej.mitrovich — 2012-11-29T14:49:22Z
*** This issue has been marked as a duplicate of issue 8892 ***