int128 on firstOrd, lastOrd and lengthOrd (#11701)

* fixes #11847
This commit is contained in:
Arne Döring 2019-08-07 15:53:16 +02:00 • committed by Andreas Rumpf
commit afbcd1b330
34 changed files with 530 additions and 314 deletions

View file

@ -186,7 +186,9 @@ proc semOrd(c: PContext, n: PNode): PNode =
if isOrdinalType(parType, allowEnumWithHoles=true):
discard
elif parType.kind == tySet:
result.typ = makeRangeType(c, firstOrd(c.config, parType), lastOrd(c.config, parType), n.info)
let a = toInt64(firstOrd(c.config, parType))
let b = toInt64(lastOrd(c.config, parType))
result.typ = makeRangeType(c, a, b, n.info)
else:
localError(c.config, n.info, errOrdinalTypeExpected)
result.typ = errorType(c)
@ -273,7 +275,7 @@ proc semDynamicBindSym(c: PContext, n: PNode): PNode =
# executed like 'normal' VM callback
idx = vm.registerCallback("bindSymImpl", bindSymWrapper)
# dummy node to carry idx information to VM
idxNode = newIntTypeNode(nkIntLit, idx, c.graph.getSysType(TLineInfo(), tyInt))
idxNode = newIntTypeNode(idx, c.graph.getSysType(TLineInfo(), tyInt))
result = copyNode(n)
for x in n: result.add x