summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/semstmts.nim10
1 files changed, 3 insertions, 7 deletions
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim
index 5f025f943..fec0a80d3 100644
--- a/compiler/semstmts.nim
+++ b/compiler/semstmts.nim
@@ -205,13 +205,12 @@ proc semCase(c: PContext, n: PNode): PNode =
   var covered: BiggestInt = 0
   var typ = commonTypeBegin
   var hasElse = false
-  var notOrdinal = false
   let caseTyp = skipTypes(n.sons[0].typ, abstractVarRange-{tyTypeDesc})
   case caseTyp.kind
   of tyInt..tyInt64, tyChar, tyEnum, tyUInt..tyUInt32, tyBool:
     chckCovered = true
   of tyFloat..tyFloat128, tyString, tyError:
-    notOrdinal = true
+    discard
   else:
     localError(n.info, errSelectorMustBeOfCertainTypes)
     return
@@ -244,9 +243,6 @@ proc semCase(c: PContext, n: PNode): PNode =
       hasElse = true
     else:
       illFormedAst(x)
-  if notOrdinal and not hasElse:
-    message(n.info, warnDeprecated,
-            "use 'else: discard'; non-ordinal case without 'else'")
   if chckCovered:
     if covered == toCover(n.sons[0].typ):
       hasElse = true
@@ -1631,7 +1627,7 @@ proc semStmtList(c: PContext, n: PNode, flags: TExprFlags): PNode =
             elif expr[2].typ.isUnresolvedStatic:
               inferConceptStaticParam(c, expr[2], expr[1])
               continue
-            
+
           let verdict = semConstExpr(c, n[i])
           if verdict.intVal == 0:
             localError(result.info, "type class predicate failed")
@@ -1655,7 +1651,7 @@ proc semStmtList(c: PContext, n: PNode, flags: TExprFlags): PNode =
           of nkPragma, nkCommentStmt, nkNilLit, nkEmpty: discard
           else: localError(n.sons[j].info, errStmtInvalidAfterReturn)
       else: discard
-  
+
   if result.len == 1 and
      c.inTypeClass == 0 and # concept bodies should be preserved as a stmt list
      result.sons[0].kind != nkDefer:
tter Kartik K. Agaram <vc@akkartik.com> 2018-01-25 22:39:31 -0800 4199' href='/akkartik/mu/commit/html/continuation2.mu.html?h=hlt&id=805d58c6aeeeba3e4989c0eed6781b3861e8fae0'>805d58c6 ^
ac07e589 ^




36365244 ^
































e4ac3c9e ^
36365244 ^
d55e7738 ^


ef7d834f ^









b301e0c0 ^
ef7d834f ^
5fe060d5 ^
ef7d834f ^


b301e0c0 ^
ef7d834f ^
805d58c6 ^



ef7d834f ^


b301e0c0 ^
ef7d834f ^
4a48bedc ^
e82dc626 ^
5fe060d5 ^

ef7d834f ^
b301e0c0 ^
ef7d834f ^
36365244 ^



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
96
97
98
99