diff options
author | Araq <rumpf_a@web.de> | 2019-06-19 09:54:01 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2019-06-19 09:54:01 +0200 |
commit | f67be92512741c0472266bbb91f7d1acaa67e178 (patch) | |
tree | 91055ef59641f2501b0c98612c56d9a49530b421 | |
parent | 296c48de5e502f61f8f969c64a8c364bfe1ee0bc (diff) | |
download | Nim-f67be92512741c0472266bbb91f7d1acaa67e178.tar.gz |
[feature] cleanup PR, refs #11424
-rw-r--r-- | compiler/semexprs.nim | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 558b450da..e99c6172f 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -541,11 +541,12 @@ proc semArrayConstr(c: PContext, n: PNode, flags: TExprFlags): PNode = if not isOrdinalType(idx.typ): localError(c.config, idx.info, "expected ordinal value for array " & "index, got '$1'" % renderTree(idx)) - firstIndex = getOrdValue(idx) - lastIndex = firstIndex - indexType = idx.typ - lastValidIndex = lastOrd(c.config, indexType) - x = x.sons[1] + else: + firstIndex = getOrdValue(idx) + lastIndex = firstIndex + indexType = idx.typ + lastValidIndex = lastOrd(c.config, indexType) + x = x.sons[1] let yy = semExprWithType(c, x) var typ = yy.typ |