t22301.nim 320 B

1234567891011121314151617
  1. discard """
  2. errormsg: "branch initialization with a runtime discriminator is not supported for a branch whose fields have default values."
  3. """
  4. # bug #22301
  5. type
  6. Enum = enum A, B
  7. Object = object
  8. case a: Enum
  9. of A:
  10. integer: int = 200
  11. of B:
  12. time: string
  13. let x = A
  14. let s = Object(a: x)
  15. echo s