Skip to content

Commit

Permalink
Merge pull request #6175 from MartinNowak/fix16570
Browse files Browse the repository at this point in the history
fix Issue 16570 - Enum member with interpreted...
  • Loading branch information
MartinNowak authored Oct 8, 2016
2 parents 131668b + 620ecc2 commit fa464f3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/dcast.d
Original file line number Diff line number Diff line change
Expand Up @@ -1633,7 +1633,7 @@ extern (C++) Expression castTo(Expression e, Scope* sc, Type t)
}

Lok:
result = new CastExp(e.loc, e, tob);
result = new CastExp(e.loc, e, t);
result.type = t; // Don't call semantic()
//printf("Returning: %s\n", result->toChars());
}
Expand Down
8 changes: 8 additions & 0 deletions test/compilable/test16570.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
static immutable int _a = 0;

enum Regression
{
a = _a,
}

static assert(is(typeof(Regression.a) == Regression));

0 comments on commit fa464f3

Please sign in to comment.