Bug 2647 – typedef's and struct constructors

Status
RESOLVED
Resolution
WONTFIX
Severity
minor
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
All
Creation time
2009-02-06T02:25:00Z
Last change time
2015-06-09T01:21:01Z
Keywords
spec
Assigned to
nobody
Creator
s.d.hammett

Comments

Comment #0 by s.d.hammett — 2009-02-06T02:25:38Z
when using typedefs of structs their constructors return the original type instead of the new type struct Ca { this(int a) { _answer = a / 2; } int _answer; } void testClasses() { typedef Ca Da; Ca a = Ca(84); Da c = Da(84); } tests0.d(38): Error: cannot implicitly convert expression (((Ca __ctmp276 = __ctmp276 = 0; ) , __ctmp276).this(84)) of type Ca to Da A cast is required for the code to work.
Comment #1 by clugdbug — 2009-11-19T07:56:32Z
Dropping typedef, so won't fix.