Skip to content

Commit

Permalink
fix Issue 13027 - Assertion `ex->op == TOKblit || ex->op == TOKconstr…
Browse files Browse the repository at this point in the history
…uct' failed.
  • Loading branch information
9rnsr committed Jul 4, 2014
1 parent 1cccc74 commit 002cafc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/declaration.c
Expand Up @@ -1541,8 +1541,8 @@ void VarDeclaration::semantic(Scope *sc)
Expression *ex = ei->exp;
while (ex->op == TOKcomma)
ex = ((CommaExp *)ex)->e2;
assert(ex->op == TOKblit || ex->op == TOKconstruct);
ex = ((AssignExp *)ex)->e2;
if (ex->op == TOKblit || ex->op == TOKconstruct)
ex = ((AssignExp *)ex)->e2;
if (ex->op == TOKnew)
{
// See if initializer is a NewExp that can be allocated on the stack
Expand Down
10 changes: 10 additions & 0 deletions test/fail_compilation/ice13027.d
@@ -0,0 +1,10 @@
/*
TEST_OUTPUT:
---
fail_compilation/ice13027.d(9): Error: template instance b!"c" template 'b' is not defined
---
*/
void main()
{
scope a = b!"c";
}

0 comments on commit 002cafc

Please sign in to comment.