From fa4644006a618924985bc95bf899b60ea73d8c94 Mon Sep 17 00:00:00 2001 From: Neelesh Chandola Date: Thu, 13 Dec 2018 14:12:22 +0530 Subject: [PATCH] Check for ordinal type --- compiler/semtypes.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index cb0402018c..9961deee0d 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -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)