https://d.puremagic.com/issues/show_bug.cgi?id=12262

           Summary: regression(2.065): isTemplateInstantiation
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: [email protected]
        ReportedBy: [email protected]


--- Comment #0 from Timothee Cour <[email protected]> 2014-02-25 
23:09:20 PST ---
See below (CT error); is that related to issue 12261 ?

version(unittest){
  struct A1(T){}
  struct A2{}
  template A3(T){
    struct A{}
  }
  struct A4(alias fun,T...){}
}

template GetTemplateParent(T : TI!TP, alias TI, TP...)
{
  alias GetTemplateParent = TI;
}
template GetTemplateParent(alias T : TI!TP, alias TI, TP...)
{
  //TODO: how come this doesn't work with functions?
  alias GetTemplateParent = TI;
}

template isTemplateInstantiation(T...) if(T.length==1)
{
  enum isTemplateInstantiation=is(typeof(GetTemplateParent!T));
}
unittest
{
  static assert(isTemplateInstantiation!(A1!double));
  static assert(!isTemplateInstantiation!(A1));
  static assert(!isTemplateInstantiation!(A2));
  static assert(!isTemplateInstantiation!(A3));
  static assert(isTemplateInstantiation!(A3!double));
  static assert(!isTemplateInstantiation!(A3!double.A)); //CT error
  static assert(!isTemplateInstantiation!(int));
}

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

Reply via email to