This commit is contained in:
Andreas Rumpf 2017-11-02 15:39:44 +01:00
commit 30b098fcaf
6 changed files with 10 additions and 8 deletions

View file

@ -168,7 +168,9 @@ proc semTypeTraits(c: PContext, n: PNode): PNode =
proc semOrd(c: PContext, n: PNode): PNode =
result = n
let parType = n.sons[1].typ
if isOrdinalType(parType) or parType.kind == tySet:
if isOrdinalType(parType):
discard
elif parType.kind == tySet:
result.typ = makeRangeType(c, firstOrd(parType), lastOrd(parType), n.info)
else:
localError(n.info, errOrdinalTypeExpected)