Require ordinal or set argument to system.ord
This commit is contained in:
parent
8ebce3ce2b
commit
674a1110f0
1 changed files with 6 additions and 2 deletions
|
|
@ -114,8 +114,12 @@ proc semTypeTraits(c: PContext, n: PNode): PNode =
|
|||
|
||||
proc semOrd(c: PContext, n: PNode): PNode =
|
||||
result = n
|
||||
result.typ = makeRangeType(c, firstOrd(n.sons[1].typ),
|
||||
lastOrd(n.sons[1].typ), n.info)
|
||||
let parType = n.sons[1].typ
|
||||
if isOrdinalType(parType) or parType.kind == tySet:
|
||||
result.typ = makeRangeType(c, firstOrd(parType), lastOrd(parType), n.info)
|
||||
else:
|
||||
localError(n.info, errOrdinalTypeExpected)
|
||||
result.typ = errorType(c)
|
||||
|
||||
proc semBindSym(c: PContext, n: PNode): PNode =
|
||||
result = copyNode(n)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue