D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4195 - Forward reference error with struct opCall and const
Summary: Forward reference error with struct opCall and const
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Windows
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-16 04:05 UTC by strtr
Modified: 2015-06-09 01:31 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description strtr 2010-05-16 04:05:42 UTC
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 Infiltrator 2014-03-18 23:00:52 UTC
The provided code works as of v2.065.