tambiguousoverloads.nim 508 B

123456789101112131415161718192021222324252627
  1. discard """
  2. cmd: "nim check --hints:off $file"
  3. """
  4. block: # bug #21887
  5. type
  6. EnumA = enum A = 300, B
  7. EnumB = enum A = 10
  8. EnumC = enum C
  9. doAssert typeof(EnumC(A)) is EnumC #[tt.Error
  10. ^ ambiguous identifier 'A' -- use one of the following:
  11. EnumA.A: EnumA
  12. EnumB.A: EnumB]#
  13. block: # issue #22598
  14. type
  15. A = enum
  16. red
  17. B = enum
  18. red
  19. let a = red #[tt.Error
  20. ^ ambiguous identifier 'red' -- use one of the following:
  21. A.red: A
  22. B.red: B]#