http://d.puremagic.com/issues/show_bug.cgi?id=7464

           Summary: Better Error Message When Using S.tupleof within S
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: dsim...@yahoo.com


--- Comment #0 from David Simcha <dsim...@yahoo.com> 2012-02-08 08:54:45 PST ---
struct S {
   static if(hasIndirections!(typeof(this))) {}
}

template hasIndirections(T)
{
   enum hasIndirections = hasIndirectionsImpl!(typeof(T.init.tupleof));
}

template hasIndirectionsImpl(T...)
{
   static if (!T.length)
   {
       enum hasIndirectionsImpl = false;
   }
   else
   {
       enum hasIndirectionsImpl = true;
   }
}

This is wrong because S isn't fully defined yet, so S.init.tupleof makes no
sense.  However, the error message is extremely obtuse:

Error: struct S no size yet for forward reference

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

Reply via email to