mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-08 05:53:22 +00:00
Check for ordinal type
This commit is contained in:
@@ -618,8 +618,8 @@ proc semRecordCase(c: PContext, n: PNode, check: var IntSet, pos: var int,
|
||||
of tyFloat..tyFloat128, tyString, tyError:
|
||||
discard
|
||||
else:
|
||||
localError(c.config, n.info, "selector must be of an ordinal type, float or string")
|
||||
return
|
||||
if not isOrdinalType(typ):
|
||||
localError(c.config, n.info, "selector must be of an ordinal type, float or string")
|
||||
for i in countup(1, sonsLen(n) - 1):
|
||||
var b = copyTree(n.sons[i])
|
||||
addSon(a, b)
|
||||
|
||||
Reference in New Issue
Block a user