www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14484] New: IFTI doesn't work with TemplateThisParameter and

https://issues.dlang.org/show_bug.cgi?id=14484

          Issue ID: 14484
           Summary: IFTI doesn't work with TemplateThisParameter and
                    inheritance
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: thecybershadow gmail.com

Maybe I don't understand what TemplateThisParameter is for, but I'd think this
should work:

/////////// test.d //////////
class A
{
    final void f(this This)()
    {
        pragma(msg, This);
    }
}

class B : A
{
    final void x()
    {
        f();
    }
}
/////////////////////////////

I would expect f to be instantiated with This==B.

--
Apr 23 2015