Skip to content

Commit

Permalink
Merge pull request #7055 from JinShil/stable
Browse files Browse the repository at this point in the history
Fix Issue 17684 - [REG 2.062] static alias this
  • Loading branch information
MartinNowak committed Aug 3, 2017
2 parents 95dba7d + 9cdaed6 commit 9df5522
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ddmd/expression.d
Expand Up @@ -12921,6 +12921,8 @@ extern (C++) class AssignExp : BinExp
Expression e2x = inferType(e2, t1.baseElemOf());
e2x = e2x.semantic(sc);
e2x = resolveProperties(sc, e2x);
if (e2x.op == TOKtype)
e2x = resolveAliasThis(sc, e2x); //https://issues.dlang.org/show_bug.cgi?id=17684
if (e2x.op == TOKerror)
return e2x;
if (e2x.checkValue())
Expand Down
12 changes: 12 additions & 0 deletions test/runnable/test17684.d
@@ -0,0 +1,12 @@
private struct StaticStruct
{
static int value;
static alias value this;
}

void main()
{
StaticStruct = 42;
immutable int a = StaticStruct;
assert(a == 42);
}

0 comments on commit 9df5522

Please sign in to comment.