Showing with 26 additions and 1 deletion.
  1. +1 −1 src/statement.c
  2. +9 −0 test/compilable/imports/test14666a.d
  3. +8 −0 test/compilable/imports/test14666b.d
  4. +8 −0 test/compilable/test14666.d
2 changes: 1 addition & 1 deletion src/statement.c
Original file line number Diff line number Diff line change
Expand Up @@ -5311,7 +5311,7 @@ Statement *ImportStatement::semantic(Scope *sc)
}

s->semantic(sc);
s->semantic2(sc);
//s->semantic2(sc); // Bugzilla 14666
sc->insert(s);

for (size_t j = 0; j < s->aliasdecls.dim; j++)
Expand Down
9 changes: 9 additions & 0 deletions test/compilable/imports/test14666a.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module imports.test14666a;

auto getNames()
{
import imports.test14666b;
return "";
}

enum Names = getNames;
8 changes: 8 additions & 0 deletions test/compilable/imports/test14666b.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module imports.test14666b;

import test14666;

struct Token
{
Location location;
}
8 changes: 8 additions & 0 deletions test/compilable/test14666.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// REQUIRED_ARGS: -o-
// PERMUTE_ARGS:
module test14666;

struct Location
{
import imports.test14666a;
}