'ord' does not produce a range type anymore
This commit is contained in:
parent
b7bce6f900
commit
762ade1177
4 changed files with 7 additions and 4 deletions
|
|
@ -109,3 +109,4 @@ proc initDefines*() =
|
|||
defineSymbol("nimGenericInOutFlags")
|
||||
when false: defineSymbol("nimHasOpt")
|
||||
defineSymbol("nimNoArrayToCstringConversion")
|
||||
defineSymbol("nimNewRoof")
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue