Skip to content

Commit

Permalink
Merge pull request #3991 from 9rnsr/fix13479
Browse files Browse the repository at this point in the history
[REG2.067a] Issue 13479 - Templates not emitted when instantiated in mixins mixed in functions
  • Loading branch information
dnadlinger committed Sep 15, 2014
2 parents 17e51a0 + 22ff2a5 commit fa25bae
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/e2ir.c
Expand Up @@ -1091,7 +1091,7 @@ elem *toElem(Expression *e, IRState *irs)

void visit(DeclarationExp *de)
{
//printf("DeclarationExp::toElem() %s\n", detoChars());
//printf("DeclarationExp::toElem() %s\n", de->toChars());
result = Dsymbol_toElem(de->declaration);
}

Expand Down Expand Up @@ -4826,6 +4826,10 @@ elem *toElem(Expression *e, IRState *irs)
{
irs->deferToObj->push(ed);
}
else if (TemplateInstance *ti = s->isTemplateInstance())
{
irs->deferToObj->push(ti);
}
return e;
}

Expand Down
19 changes: 19 additions & 0 deletions test/runnable/mixin2.d
Expand Up @@ -324,6 +324,24 @@ void test7553()
auto r2 = new Bar7553().to_range(1);
}

/*********************************************/
// 13479

mixin template F13479()
{
void t()()
{
}

alias t!() a;
}

void test13479()
{
mixin F13479!();
a();
}

/*********************************************/

void main()
Expand All @@ -339,6 +357,7 @@ void main()
test9();
test10();
test7156();
test13479();

writeln("Success");
}

0 comments on commit fa25bae

Please sign in to comment.