diff --git a/src/mtype.c b/src/mtype.c index ad4f8d0ef577..979b24750332 100644 --- a/src/mtype.c +++ b/src/mtype.c @@ -3864,6 +3864,9 @@ d_uns64 TypeAArray::size(Loc loc) Type *TypeAArray::semantic(Loc loc, Scope *sc) { //printf("TypeAArray::semantic() %s index->ty = %d\n", toChars(), index->ty); + if (deco) + return this; + this->loc = loc; this->sc = sc; if (sc) diff --git a/test/compilable/interpret3.d b/test/compilable/interpret3.d index e01836254bb0..2af617edd9bc 100644 --- a/test/compilable/interpret3.d +++ b/test/compilable/interpret3.d @@ -1108,21 +1108,18 @@ static assert(bug6001f()); // Assignment to AAs -version(X86) +void blah(int[char] as) { - void blah(int[char] as) - { - auto k = [6: as]; - as = k[6]; - } - int blaz() - { - int[char] q; - blah(q); - return 67; - } - static assert(blaz()==67); + auto k = [6: as]; + as = k[6]; +} +int blaz() +{ + int[char] q; + blah(q); + return 67; } +static assert(blaz()==67); void bug6001g(ref int[] w) {