Bug 4195 – Forward reference error with struct opCall and const

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2010-05-16T04:05:00Z
Last change time
2015-06-09T01:31:14Z
Assigned to
nobody
Creator
strtr

Comments

Comment #0 by strtr — 2010-05-16T04:05:42Z
module main; //const S S1 = S(); // uncomment this to compile struct S { float value; static S opCall() { S s; return s; } const S S2 = S(); } void main(){} -- main.d(4): Error: struct main.S no size yet for forward reference main.d(4): Error: struct main.S no size yet for forward reference main.d(11): Error: cannot evaluate opCall() at compile time
Comment #1 by lt.infiltrator — 2014-03-18T23:00:52Z
The provided code works as of v2.065.