tenum_no_rtti.nim 228 B

12345678910111213
  1. discard """
  2. output: '''A
  3. B'''
  4. cmd: '''nim c --gc:arc $file'''
  5. """
  6. type
  7. Enum = enum A, B, C
  8. EnumRange = range[A .. B]
  9. proc test_a(x: Enum): string = $x
  10. proc test_b(x: EnumRange): string = $x
  11. echo test_a(A)
  12. echo test_b(B)