http://d.puremagic.com/issues/show_bug.cgi?id=4203
Summary: Const field of struct that contains a whole struct Product: D Version: future Platform: x86 OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: bearophile_h...@eml.cc --- Comment #0 from bearophile_h...@eml.cc 2010-05-18 04:08:11 PDT --- I don't understand what's going on here, but even if this is not a bug (and to me it looks like a problem) it's too much tricky for D newbies. This runs with dmd v2.046: // case 1 struct Foo { const Foo f = Foo(); } static assert(Foo.sizeof == 1); void main() {} While this is not OK: // case 2 struct Foo { const Foo f; } static assert(Foo.sizeof == 1); void main() {} dmd v2.046 prints: test.d(2): Error: struct test.Foo cannot have field f with same struct type test.d(2): Error: struct test.Foo cannot have field f with same struct type -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------