Fixes #12379 (#12591) [backport]

This commit is contained in:
Clyybber
2019-11-04 20:57:14 +01:00
committed by Andreas Rumpf
parent 558ecd1ca6
commit cf5c3f2400
4 changed files with 21 additions and 19 deletions

View File

@@ -635,7 +635,7 @@ proc semRecordCase(c: PContext, n: PNode, check: var IntSet, pos: var int,
errorUndeclaredIdentifier(c, n.sons[0].info, typ.sym.name.s)
elif not isOrdinalType(typ):
localError(c.config, n.sons[0].info, "selector must be of an ordinal type, float or string")
elif firstOrd(c.config, typ) != 0:
if firstOrd(c.config, typ) != 0:
localError(c.config, n.info, "low(" & $a.sons[0].sym.name.s &
") must be 0 for discriminant")
elif lengthOrd(c.config, typ) > 0x00007FFF: