← Back to index
|
Original Bugzilla link
Bug 1523 – struct literals not work with typedef
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2007-09-21T01:04:00Z
Last change time
2015-06-09T01:14:16Z
Keywords
rejects-valid
Assigned to
bugzilla
Creator
pop.atry
Comments
Comment #0
by pop.atry — 2007-09-21T01:04:40Z
struct BaseStruct { int n; char c; } typedef BaseStruct MyStruct; void myFunction(MyStruct) {} int main() { myFunction(MyStruct(0, 'x')); return 0; } *********************************************** $ gdc typedef_struct_literals.d typedef_struct_literals.d:11: function typedef_struct_literals.myFunction (MyStruct) does not match parameter types (BaseStruct ) typedef_struct_literals.d:11: Error: cannot implicitly convert expression (BaseStruct(0,'x')) of type BaseStruct to MyStruct
Comment #1
by dvdfrdmn — 2007-09-23T16:19:58Z
Present in DMD 1 and 2.
Comment #2
by dvdfrdmn — 2007-09-23T16:21:36Z
Reassigning to Walter
Comment #3
by thomas-dloop — 2007-09-30T05:00:40Z
Added to DStress as
http://dstress.kuehne.cn/run/s/struct_initialization_13_A.d
http://dstress.kuehne.cn/run/s/struct_initialization_13_B.d
http://dstress.kuehne.cn/run/s/struct_initialization_13_C.d
Comment #4
by braddr — 2007-10-20T03:46:56Z
Fixed in 1.022/2.005