summary refs log tree commit diff stats
path: root/tests/objvariant/tnon_zero_discrim_err.nim
blob: c595bba1bde31eb48c1989f76954bb168ce09b67 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
discard """
  errormsg: "low(kind) must be 0 for discriminant"
  line: 7
"""
type
  HoledObj = object
    case kind: int
    of 0: a: int
    else: discard

let someInt = low(int)
case someInt
of 938: echo HoledObj(kind: someInt, a: 1)
else: discard