[Issue 5946] New: failing lookup 'this' from function in template
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat May 7 07:02:04 PDT 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5946
Summary: failing lookup 'this' from function in template
Product: D
Version: unspecified
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> 2011-05-07 06:58:08 PDT ---
Following code compile fails with
https://github.com/D-Programming-Language/dmd/commit/3fcc2344681ab9d31d1897188f36051c9beb247f
----
template TTest1()
{
int call(){ return this.g(); }
}
class CTest1
{
int f() { mixin TTest1!(); return call(); }
int g() { return 10; }
}
void main()
{
assert((new CTest1()).f() == 10);
}
----
test.d(3): Error: 'this' is only defined in non-static member functions, not
call
test.d(7): Error: mixin test.CTest1.f.TTest1!() error instantiating
----
--
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