Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/template.c
Original file line number Diff line number Diff line change
Expand Up @@ -3703,10 +3703,15 @@ MATCH deduceType(RootObject *o, Scope *sc, Type *tparam, TemplateParameters *par
if (tx)
{
s = tx->toDsymbol(sc);
if (s)
if (TemplateInstance *ti = s ? s->parent->isTemplateInstance() : NULL)
{
TemplateInstance *ti = s->parent->isTemplateInstance();
s = ti ? ti->tempdecl : NULL;
// Bugzilla 14290: Try to match with ti->tempecl,
// only when ti is an enclosing instance.
Dsymbol *p = sc->parent;
while (p && p != ti)
p = p->parent;
if (p)
s = ti->tempdecl;
}
}
if (s)
Expand Down
7 changes: 7 additions & 0 deletions test/runnable/template9.d
Original file line number Diff line number Diff line change
Expand Up @@ -1592,6 +1592,13 @@ void test12()
t.foo!Tuple12();
}

/**********************************/
// 14290

struct Foo14290(int i) {}
alias Foo14290a = Foo14290!1;
static assert(!is(Foo14290!2 == Foo14290a!T, T...));

/**********************************/
// 8125

Expand Down