Bug 12009 – local import and "unable to resolve forward reference" error

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-01-27T01:46:00Z
Last change time
2015-11-25T16:24:02Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
k.hara.pg
Blocks
12000

Comments

Comment #0 by k.hara.pg — 2014-01-27T01:46:25Z
Test case: struct RefCounted(T) { struct RefCountedStore { private struct Impl { T _payload; } private Impl* _store; } RefCountedStore _refCounted; ~this() { import core.stdc.stdlib : free; } } struct GroupBy(R) { struct SharedInput { Group unused; } struct Group { private RefCounted!SharedInput _allGroups; } } void main() { GroupBy!(int[]) g1; } Output: test.d(5): Error: struct test.RefCounted!(SharedInput).RefCounted.RefCountedStore.Impl unable to resolve forward reference in definition test.d(29): Error: template instance test.RefCounted!(SharedInput) error instantiating test.d(35): instantiated from here: GroupBy!(int[]) test.d(35): Error: template instance test.GroupBy!(int[]) error instantiating
Comment #1 by k.hara.pg — 2014-04-02T23:04:59Z
Comment #2 by github-bugzilla — 2014-04-11T01:46:48Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/9681667045165278d3d9bfcabf4f2f4663416b79 fix Issue 12009 - local import and "unable to resolve forward reference" error `Module::semantic2` could be invoked from local imports, even when some local symbol semantics are not yet completed. https://github.com/D-Programming-Language/dmd/commit/915c8806b1c390a6306fad39d80f14602fbe3f09 Merge pull request #3418 from 9rnsr/fix12009 Issue 12009 - local import and "unable to resolve forward reference" error
Comment #3 by github-bugzilla — 2015-11-25T16:24:02Z
Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/bd4447534d132e6ed04db96b9183989ae3f551ad fix Issue 12009 - local import and "unable to resolve forward reference" error `Module::semantic2` could be invoked from local imports, even when some local symbol semantics are not yet completed.