Summary: Forward reference error with member pure function
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Shin Fujishiro <> 2010-10-23 00:36:15 PDT 
dmd trunk r727.  Forward reference error happens if a member pure function of
struct S has a parameter of the type S:
struct S
    bool fun(S s) pure { return true; }
% dmd -o- -c test.d
test.d(2): Error: struct test.S no size yet for forward reference

The error happens in TypeStruct::hasPointers() called from
TypeFunction::semantic() around line 5011 of mtype.c:
        Type *t = fparam->type->toBasetype();
>>      if (!t->hasPointers())
        if (t->mod & (MODimmutable | MODwild))

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to