Thread overview
[Issue 5946] New: failing lookup 'this' from function in template
May 07, 2011
Kenji Hara
Jul 01, 2011
Walter Bright
Jul 01, 2011
Walter Bright
Jul 01, 2011
Walter Bright
May 07, 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@puremagic.com
        ReportedBy: k.hara.pg@gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg@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: -------
July 01, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5946


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|                            |FIXED


--- Comment #1 from Walter Bright <bugzilla@digitalmars.com> 2011-07-01 00:34:37 PDT ---
https://github.com/D-Programming-Language/dmd/commit/5a1f396e915e083ce30c5f09f4e1ef1a9e704fda

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
July 01, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5946



--- Comment #2 from Walter Bright <bugzilla@digitalmars.com> 2011-07-01 00:36:46 PDT ---
https://github.com/D-Programming-Language/dmd/commit/5a1f396e915e083ce30c5f09f4e1ef1a9e704fda

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
July 01, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5946



--- Comment #3 from Walter Bright <bugzilla@digitalmars.com> 2011-07-01 01:07:40 PDT ---
https://github.com/D-Programming-Language/dmd/commit/8359ec9e14dc7294360d954325aacd4dcaed35c7

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