Bug 3675 – Regression: Struct literals cannot be initialized with another struct literal
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2010-01-05T01:14:00Z
Last change time
2015-06-09T01:26:55Z
Keywords
patch, rejects-valid
Assigned to
nobody
Creator
clugdbug
Comments
Comment #0 by clugdbug — 2010-01-05T01:14:34Z
Worked in DMD2.034, fails on 2.035 and later.
And where the heck did the type int come from???
----
struct CopyTest
{
double x;
}
enum CopyTest z = CopyTest(5.3);
enum CopyTest w = z;
------
bug.d(6): Error: cannot implicitly convert expression ((CopyTest)(5.3)) of type int to CopyTest
Comment #1 by clugdbug — 2010-01-05T04:38:28Z
ROOT CAUSE: This was a bug in my patch to bug 3190.
PATCH:
expression.c, DsymbolExp::semantic(), line 2359.
if ((v->storage_class & STCmanifest) && v->init)
{
e = v->init->toExpression();
- e->semantic(sc);
+ e = e->semantic(sc);
return e;
}