From f934c9213220bbb4f0ac13aa804ab14c3393202e Mon Sep 17 00:00:00 2001 From: Araq Date: Sun, 9 Aug 2015 23:37:13 +0200 Subject: fixes #3096 --- compiler/semtypes.nim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'compiler') diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 3bb1284fc..5ae3d16c0 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -508,8 +508,9 @@ proc semRecordCase(c: PContext, n: PNode, check: var IntSet, pos: var int, var typ = skipTypes(a.sons[0].typ, abstractVar-{tyTypeDesc}) if not isOrdinalType(typ): localError(n.info, errSelectorMustBeOrdinal) - elif firstOrd(typ) < 0: - localError(n.info, errOrdXMustNotBeNegative, a.sons[0].sym.name.s) + elif firstOrd(typ) != 0: + localError(n.info, errGenerated, "low(" & $a.sons[0].sym.name.s & + ") must be 0 for discriminant") elif lengthOrd(typ) > 0x00007FFF: localError(n.info, errLenXinvalid, a.sons[0].sym.name.s) var chckCovered = true -- cgit 1.4.1-2-gfad0