mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 01:44:37 +00:00
[feature] cleanup PR, refs #11424
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user