Skip to content

Commit

Permalink
Fix Issue 17143 - [REG2.072.0] Declaration is already defined on glob…
Browse files Browse the repository at this point in the history
…al enum = tuple(...).expand declaration

Regression was introduced in 53a70e4
  • Loading branch information
epi committed Feb 4, 2017
1 parent dc279ec commit 555a9a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/expression.d
Expand Up @@ -8961,7 +8961,7 @@ extern (C++) final class DotVarExp : UnaExp
* tuple(e1.a, e1.b, e1.c)
*/
Expression e0;
Expression ev = extractSideEffect(sc, "__tup", e0, e1);
Expression ev = sc.func ? extractSideEffect(sc, "__tup", e0, e1) : e1;

auto exps = new Expressions();
exps.reserve(tup.objects.dim);
Expand Down
4 changes: 4 additions & 0 deletions test/compilable/test17143.d
@@ -0,0 +1,4 @@
import std.typecons : tuple;
enum foo = tuple(1, 2).expand;
pragma(msg, typeof(foo).stringof);
pragma(msg, foo.stringof);

0 comments on commit 555a9a1

Please sign in to comment.