[Issue 8325] New: IFTI on non-function templates

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jun 30 07:51:09 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8325

           Summary: IFTI on non-function templates
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid, wrong-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: timon.gehr at gmx.ch


--- Comment #0 from timon.gehr at gmx.ch 2012-06-30 07:53:44 PDT ---
DMD 2.059:
template X(){
    double X(double){return 2;}
    float X(float){return 3;}
}
static assert(!is(typeof(X(2))));               // fail
static assert(is(typeof(X!()(2.0f)) == float)); // fail
static assert(is(typeof(X(2.0))==double));      // ok
static assert(is(typeof(X(2.0f))==float));      // fail

All static assertions should pass.

IFTI should not have any other effect than implicit template instantiation if
the
template in question contains more than one declaration.

-- 
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