summary refs log tree commit diff stats
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
parentbbf9757b4e70c7a11701656bc7755d7d76669dad (diff)
downloadNim-f934c9213220bbb4f0ac13aa804ab14c3393202e.tar.gz
fixes #3096
-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
pan> ^
2bf6f5793 ^
e8eb496e6 ^

2bf6f5793 ^



e8eb496e6 ^
2bf6f5793 ^


e8eb496e6 ^
2bf6f5793 ^
9f3109687 ^
ca18dc250 ^










































1551fff85 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95