Skip to content

Commit

Permalink
fix Issue 14666 - Bogus forward reference error
Browse files Browse the repository at this point in the history
  • Loading branch information
9rnsr committed Jun 10, 2015
1 parent 4e5a31e commit 0504d66
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
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;
}

0 comments on commit 0504d66

Please sign in to comment.