http://d.puremagic.com/issues/show_bug.cgi?id=6994
Summary: Using explicit 'this' in template constraint causes an
error
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Keywords: rejects-valid
Severity: normal
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Kenji Hara <[email protected]> 2011-11-23 00:29:54 PST ---
struct Foo {
T get(T)(){ return T.init; }
T func1(T)()
if (__traits(compiles, get!T()))
{ return get!T; }
T func2(T)()
if (__traits(compiles, this.get!T())) // add explicit 'this'
{ return get!T; }
}
void main()
{
Foo foo;
foo.get!int(); // OK
foo.func1!int(); // OK
foo.func2!int(); // NG
}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------