Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #2336 from hpohl/10612
[REG2.064a] fix issue 10612 - ICE on using enum as hash key with mutual module imports
  • Loading branch information
9rnsr committed Jul 13, 2013
2 parents 3c960ff + 797832d commit a608afd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/mtype.c
Expand Up @@ -4509,7 +4509,7 @@ Type *TypeAArray::semantic(Loc loc, Scope *sc)
return tsa->semantic(loc, sc);
}
else if (t)
index = t;
index = t->semantic(loc, sc);
else
{ index->error(loc, "index is not a type or an expression");
return Type::terror;
Expand Down Expand Up @@ -7269,7 +7269,11 @@ Type *TypeEnum::syntaxCopy()
Type *TypeEnum::semantic(Loc loc, Scope *sc)
{
//printf("TypeEnum::semantic() %s\n", toChars());
//sym->semantic(sc);
if (!sym->isdone)
{
assert(sym->scope);
sym->semantic(sym->scope);
}
return merge();
}

Expand Down
9 changes: 9 additions & 0 deletions test/runnable/testenum.d
Expand Up @@ -246,6 +246,15 @@ void test10561()
static assert(is(typeof(h) == float[]));
}

/**********************************************/
// 10612

int[E10612] ie10612;
E10612[int] ei10612;
E10612[E10612] ee10612;

enum E10612 { a }

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

int main()
Expand Down

0 comments on commit a608afd

Please sign in to comment.