fix semcase on tySequence and tyObject #20283 #19682 (#20339)

* fix semcase on tySequence and tyObject #20283 #19682

* use better arg name

* avoiding returns nil use errorNode instead, clean code

* use efNoDiagnostics flag

* remove tests/errmsgs/t19682.nim

* combine 2 test cases to one file

(cherry picked from commit eec1543baf)
This commit is contained in:
Bung
2022-11-01 17:19:37 +08:00
committed by narimiran
parent 42ff3aa75a
commit 98756bb26b
4 changed files with 38 additions and 9 deletions

View File

@@ -0,0 +1,29 @@
discard """
cmd: "nim check --hints:off $file"
errormsg: ""
nimout: '''
tcase_stmt.nim(22, 7) Error: selector must be of an ordinal type, float or string
tcase_stmt.nim(28, 6) Error: selector must be of an ordinal type, float or string
'''
"""
# bug #19682
type A = object
case A()
else:
discard
# bug #20283
case @[]
else: discard