← Back to index
|
Original Bugzilla link
Bug 5946 – failing lookup 'this' from function in template
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-05-07T06:58:00Z
Last change time
2015-06-09T05:15:12Z
Keywords
rejects-valid
Assigned to
nobody
Creator
k.hara.pg
Comments
Comment #0
by k.hara.pg — 2011-05-07T06:58:08Z
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 ----
Comment #1
by bugzilla — 2011-07-01T00:34:37Z
https://github.com/D-Programming-Language/dmd/commit/5a1f396e915e083ce30c5f09f4e1ef1a9e704fda
Comment #2
by bugzilla — 2011-07-01T00:36:46Z
https://github.com/D-Programming-Language/dmd/commit/5a1f396e915e083ce30c5f09f4e1ef1a9e704fda
Comment #3
by bugzilla — 2011-07-01T01:07:40Z
https://github.com/D-Programming-Language/dmd/commit/8359ec9e14dc7294360d954325aacd4dcaed35c7