Mercurial > projects > ddmd
diff dmd/TypeAArray.d @ 135:af1bebfd96a4 dmd2037
dmd 2.038
author | Eldar Insafutdinov <e.insafutdinov@gmail.com> |
---|---|
date | Mon, 13 Sep 2010 22:19:42 +0100 |
parents | 010eb8f0e18d |
children | af724d3510d7 |
line wrap: on
line diff
--- a/dmd/TypeAArray.d Sat Sep 11 13:03:39 2010 +0100 +++ b/dmd/TypeAArray.d Mon Sep 13 22:19:42 2010 +0100 @@ -116,7 +116,7 @@ else index = index.semantic(loc,sc); - if (index.nextOf() && !index.nextOf().isInvariant()) + if (index.nextOf() && !index.nextOf().isImmutable()) { index = index.constOf().mutableOf(); static if (false) @@ -330,9 +330,7 @@ version (LOGDEFAULTINIT) { printf("TypeAArray.defaultInit() '%s'\n", toChars()); } - Expression e = new NullExp(loc); - e.type = this; - return e; + return new NullExp(loc, this); } override MATCH deduceType(Scope sc, Type tparam, TemplateParameters parameters, Objects dedtypes) @@ -385,10 +383,10 @@ { TypeAArray ta = cast(TypeAArray)to; - if (!(next.mod == ta.next.mod || ta.next.mod == MODconst)) + if (!MODimplicitConv(next.mod, ta.next.mod)) return MATCHnomatch; // not const-compatible - if (!(index.mod == ta.index.mod || ta.index.mod == MODconst)) + if (!MODimplicitConv(index.mod, ta.index.mod)) return MATCHnomatch; // not const-compatible MATCH m = next.constConv(ta.next);