Bug 8609 – A forward reference error with static arrays

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-09-02T12:16:00Z
Last change time
2015-06-17T21:03:22Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2012-09-02T12:16:00Z
This compiles with no errors: struct Tuple(T) { T arg; } struct Foo { Bar b; } struct Bar { int x; Tuple!(Foo) spam() { return Tuple!(Foo)(); } } void main() {} While this gives a forward reference error: struct Tuple(T) { T arg; } struct Foo { Bar b; } struct Bar { int x; Tuple!(Foo[1]) spam() { return Tuple!(Foo[1])(); } } void main() {} DMD 2.061alpha: test.d(4): Error: struct test.Foo no size yet for forward reference test.d(4): Error: struct test.Foo no size yet for forward reference test.d(9): Error: template instance test.Tuple!(Foo[1u]) error instantiating
Comment #1 by k.hara.pg — 2013-04-06T01:30:32Z
Comment #2 by github-bugzilla — 2013-04-07T00:10:32Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/31496352d31c5c361178397f6559e09c275334d1 fix Issue 8609 - A forward reference error with static arrays https://github.com/D-Programming-Language/dmd/commit/41fa521d09efc63cb62812ce54953c25b36c22e3 Merge pull request #1849 from 9rnsr/fix8609 Issue 8609 - A forward reference error with static arrays
Comment #3 by github-bugzilla — 2015-03-30T06:10:36Z
Comment #4 by github-bugzilla — 2015-06-17T21:03:22Z