[Issue 7464] New: Better Error Message When Using S.tupleof within S
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Feb 8 08:54:46 PST 2012
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: nobody at puremagic.com
ReportedBy: dsimcha at yahoo.com
--- Comment #0 from David Simcha <dsimcha at 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: -------
More information about the Digitalmars-d-bugs
mailing list