Bug 9417 – "no size yet for forward reference" error with nested structure

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-01-28T09:54:00Z
Last change time
2013-04-06T16:09:29Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
maximzms

Comments

Comment #0 by maximzms — 2013-01-28T09:54:56Z
Code: -------------------- mixin template Foo() { void foo() {} } void main() { struct B { mixin Foo; } } -------------------- Compiler output: -------------------- test.d(9): Error: struct test.main.B no size yet for forward reference test.d(10): Error: mixin test.main.B.Foo!() error instantiating -------------------- Observations: - This error appears only with DMD from Git head, no error with v2.060. - No error if the structure is placed outside main() - No error if template has no function inside - The same error appears if structure is placed inside a unittest block - No error if the structure is placed inside other structure or class
Comment #1 by k.hara.pg — 2013-04-06T06:26:28Z
Comment #2 by k.hara.pg — 2013-04-06T10:52:17Z
*** Issue 2458 has been marked as a duplicate of this issue. ***
Comment #3 by github-bugzilla — 2013-04-06T16:09:05Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/34cd64232af44baba392f7f860f9603750ef82c9 fix Issue 9417 - "no size yet for forward reference" error with nested structure https://github.com/D-Programming-Language/dmd/commit/5159d931eab483427bf6cc60b9b39dcdabc24c6c Merge pull request #1851 from 9rnsr/fix9417 Issue 9417 - "no size yet for forward reference" error with nested structure