Files
Nim/tests/reject/tcaseexpr1.nim
Zahary Karadjov 9c8bc3a244 the is operator now works with type classes and type variables
bugfixes:
the DLL tests were failing on Mac OS X, due to an incorrect DynlibFormat
2012-10-03 01:59:49 +03:00

31 lines
384 B
Nim

discard """
file: "tcaseexpr1.nim"
line: 29
errormsg: "type mismatch: got (string) but expected 'int'"
line: 23
errormsg: "not all cases are covered"
"""
type
E = enum A, B, C
proc foo(x): auto =
return case x
of 1..9: "digit"
else: "number"
var r = foo(10)
var x = C
var t1 = case x:
of A: "a"
of B: "b"
var t2 = case x:
of A: 10
of B, C: "23"