tcorrectcheckedfield.nim 448 B

1234567891011121314151617181920212223
  1. discard """
  2. matrix: "; --warning[ProveField]:on --warningAsError[ProveField]:on; --experimental:strictCaseObjects"
  3. """
  4. block: # issue #24021
  5. type
  6. FooKind = enum
  7. a
  8. b
  9. BiggerEnum = enum b1, b2, b3, b4, b5, b6, b7, b8, b9, b10
  10. Foo = object
  11. case kind: FooKind
  12. of a: discard
  13. else:
  14. z: BiggerEnum
  15. proc p(foo: Foo, val: int) =
  16. case foo.kind
  17. of a:
  18. discard
  19. else:
  20. discard foo.z