www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4799] New: template alias parameters cannot take 'this'

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4799

           Summary: template alias parameters cannot take 'this'
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: zan77137 nifty.com


--- Comment #0 from SHOO <zan77137 nifty.com> 2010-09-03 08:11:24 PDT ---
This code doesn't work:
----------------------------------------------------
template Template(alias v){ bool Template = true; }

class C
{
        void func() { assert(Template!(this)); }
}
----------------------------------------------------

Results:
prog.d(5): Error: expression this is not a valid template value argument
prog.d(5): Error: template instance prog.Template!(this) error instantiating


I wondered whether it is specified behavior.
But, I think this code should be able to compile.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 03 2010
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4799


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
             Status|NEW                         |RESOLVED
                 CC|                            |k.hara.pg gmail.com
         Resolution|                            |DUPLICATE


--- Comment #1 from Kenji Hara <k.hara.pg gmail.com> 2011-05-07 06:20:37 PDT ---
*** This issue has been marked as a duplicate of issue 693 ***

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