summary refs log tree commit diff stats
path: root/tests/objects/t22301.nim
blob: 8746bf584dec01f0350ace663079d6ad110cbf36 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
discard """
  errormsg: "branch initialization with a runtime discriminator is not supported for a branch whose fields have default values."
"""

# bug #22301
type
  Enum = enum A, B
  Object = object
    case a: Enum
    of A:
      integer: int = 200
    of B:
      time: string

let x = A
let s = Object(a: x)
echo s