Check for ordinal type
This commit is contained in:
parent
b2411db541
commit
fa4644006a
1 changed files with 2 additions and 2 deletions
|
|
@ -618,8 +618,8 @@ proc semRecordCase(c: PContext, n: PNode, check: var IntSet, pos: var int,
|
||||||
of tyFloat..tyFloat128, tyString, tyError:
|
of tyFloat..tyFloat128, tyString, tyError:
|
||||||
discard
|
discard
|
||||||
else:
|
else:
|
||||||
localError(c.config, n.info, "selector must be of an ordinal type, float or string")
|
if not isOrdinalType(typ):
|
||||||
return
|
localError(c.config, n.info, "selector must be of an ordinal type, float or string")
|
||||||
for i in countup(1, sonsLen(n) - 1):
|
for i in countup(1, sonsLen(n) - 1):
|
||||||
var b = copyTree(n.sons[i])
|
var b = copyTree(n.sons[i])
|
||||||
addSon(a, b)
|
addSon(a, b)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue