Skip to content

Commit

Permalink
Merge branch 'master' of github.com:D-Programming-Language/dmd
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterBright committed Sep 17, 2012
2 parents 176be58 + ff32f42 commit 9aa55b5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/expression.c
Expand Up @@ -10689,7 +10689,10 @@ Expression *AssignExp::semantic(Scope *sc)
{
checkPostblit(e2->loc, t2->nextOf());
}
e2 = e2->implicitCastTo(sc, e1->type->constOf());
if (op == TOKconstruct)
e2 = e2->castTo(sc, e1->type->constOf());
else
e2 = e2->implicitCastTo(sc, e1->type->constOf());
}
else
{
Expand Down
14 changes: 14 additions & 0 deletions test/runnable/testconst.d
Expand Up @@ -2717,6 +2717,19 @@ void test8099()
}

/************************************/
// 8201

void test8201()
{
uint[2] msa;
immutable uint[2] isa = msa;

ubyte[] buffer = [0, 1, 2, 3, 4, 5];
immutable ubyte[4] iArr = buffer[0 .. 4];
}

/************************************/
// 8212

struct S8212 { int x; }

Expand Down Expand Up @@ -2846,6 +2859,7 @@ int main()
test7757();
test8098();
test8099();
test8201();
test8212();

printf("Success\n");
Expand Down

0 comments on commit 9aa55b5

Please sign in to comment.