Bug 12262 – [REG2.065] A specialized parameter `alias a : B!A` should not match to the non-eponymous instantiated variable

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-02-25T23:09:00Z
Last change time
2014-02-27T00:52:46Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
timothee.cour2

Comments

Comment #0 by timothee.cour2 — 2014-02-25T23:09:20Z
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)); }
Comment #1 by dlang-bugzilla — 2014-02-26T00:10:50Z
Caused by the same change as issue 12261.
Comment #2 by k.hara.pg — 2014-02-26T00:44:05Z
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
Comment #3 by github-bugzilla — 2014-02-26T23:44:34Z
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