[feature] cleanup PR, refs #11424

This commit is contained in:
Araq 2019-06-19 09:54:01 +02:00
commit f67be92512

View file

@ -541,11 +541,12 @@ proc semArrayConstr(c: PContext, n: PNode, flags: TExprFlags): PNode =
if not isOrdinalType(idx.typ): if not isOrdinalType(idx.typ):
localError(c.config, idx.info, "expected ordinal value for array " & localError(c.config, idx.info, "expected ordinal value for array " &
"index, got '$1'" % renderTree(idx)) "index, got '$1'" % renderTree(idx))
firstIndex = getOrdValue(idx) else:
lastIndex = firstIndex firstIndex = getOrdValue(idx)
indexType = idx.typ lastIndex = firstIndex
lastValidIndex = lastOrd(c.config, indexType) indexType = idx.typ
x = x.sons[1] lastValidIndex = lastOrd(c.config, indexType)
x = x.sons[1]
let yy = semExprWithType(c, x) let yy = semExprWithType(c, x)
var typ = yy.typ var typ = yy.typ