Bug 1048 – the type matching of static initialization

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2007-03-10T00:50:00Z
Last change time
2014-02-16T15:22:47Z
Keywords
rejects-valid
Assigned to
nobody
Creator
wstring

Comments

Comment #0 by wstring — 2007-03-10T00:50:28Z
The following code will cause a error: Error: cannot implicitly convert expression ([2,3,4]) of type int[3] to ubyte ubyte a[3] = [2, 3 ,4];
Comment #1 by ddparnell — 2007-03-10T03:41:40Z
That worked for me. Windows XP SP2, DMD 1.007 ----------------- c:\temp>type test.d ubyte a[3] = [2, 3 ,4]; void main(){} c:\temp>dmd test.d c:\dmd\bin\..\..\dm\bin\link.exe test,,,user32+kernel32/noi; c:\temp>dmd Digital Mars D Compiler v1.007 ---------------
Comment #2 by wstring — 2007-03-10T08:51:42Z
It cannot works: void main(){ ubyte a[3] = [2, 3 ,4]; }
Comment #3 by clugdbug — 2009-09-04T06:22:30Z
This was still failing in DMD1.020, but was fixed by 1.041.