[Issue 12009] New: local import and "unable to resolve forward reference" error

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jan 27 01:46:27 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12009

           Summary: local import and "unable to resolve forward reference"
                    error
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: k.hara.pg at gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg at gmail.com> 2014-01-27 01:46:25 PST ---
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

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list