* correct error

* cleaner

* fix line info
This commit is contained in:
Jasper Jenkins
2019-05-12 23:47:30 -07:00
committed by cooldome
parent 0c869eaa47
commit 07eca7decd

View File

@@ -610,9 +610,10 @@ proc semRecordCase(c: PContext, n: PNode, check: var IntSet, pos: var int,
chckCovered = true chckCovered = true
of tyFloat..tyFloat128, tyString, tyError: of tyFloat..tyFloat128, tyString, tyError:
discard discard
else: of tyForward:
if not isOrdinalType(typ): errorUndeclaredIdentifier(c, n.sons[0].info, typ.sym.name.s)
localError(c.config, n.info, "selector must be of an ordinal type, float or string") elif not isOrdinalType(typ):
localError(c.config, n.sons[0].info, "selector must be of an ordinal type, float or string")
for i in 1 ..< sonsLen(n): for i in 1 ..< sonsLen(n):
var b = copyTree(n.sons[i]) var b = copyTree(n.sons[i])
addSon(a, b) addSon(a, b)