summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2015-08-09 23:37:13 +0200
committerAraq <rumpf_a@web.de>2015-08-09 23:37:13 +0200
commitf934c9213220bbb4f0ac13aa804ab14c3393202e (patch)
treeb82e2faee3dca6b7aedd3f76081615f537beb256 /compiler
parentbbf9757b4e70c7a11701656bc7755d7d76669dad (diff)
downloadNim-f934c9213220bbb4f0ac13aa804ab14c3393202e.tar.gz
fixes #3096
Diffstat (limited to 'compiler')
-rw-r--r--compiler/semtypes.nim5
1 files changed, 3 insertions, 2 deletions
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