www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12262] New: regression(2.065): isTemplateInstantiation

reply d-bugmail puremagic.com writes:
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: nobody puremagic.com
        ReportedBy: timothee.cour2 gmail.com



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: -------
Feb 25 2014
next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12262


Vladimir Panteleev <thecybershadow gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |thecybershadow gmail.com



10:10:50 EET ---
Caused by the same change as issue 12261.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 26 2014
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12262


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull, rejects-valid
            Summary|regression(2.065):          |[REG2.065] A specialized
                   |isTemplateInstantiation     |parameter `alias a : B!A`
                   |                            |should not match to the
                   |                            |non-eponymous instantiated
                   |                            |variable



Simplified test case:

template Inst(T) { int x; }

enum fqnSym(alias a)                      = 1;
enum fqnSym(alias a : B!A, alias B, A...) = 2;

static assert(fqnSym!(Inst!(Object)) == 2);
static assert(fqnSym!(Inst!(Object).x) == 1);

Pull request:
https://github.com/D-Programming-Language/dmd/pull/3339

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 26 2014
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12262




Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/03d23757858d31d9e8dc065b06babde58c897032
fix Issue 12262 - A specialized parameter `alias a : B!A` should not match to
the non-eponymous instantiated variable

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 26 2014
prev sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12262


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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