treportunused.nim 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. discard """
  2. matrix: "--hint:all:off --hint:XDeclaredButNotUsed"
  3. nimoutFull: true
  4. nimout: '''
  5. treportunused.nim(51, 5) Hint: 'A' is declared but not used [XDeclaredButNotUsed]
  6. treportunused.nim(52, 5) Hint: 'B' is declared but not used [XDeclaredButNotUsed]
  7. treportunused.nim(55, 5) Hint: 'D' is declared but not used [XDeclaredButNotUsed]
  8. treportunused.nim(56, 5) Hint: 'E' is declared but not used [XDeclaredButNotUsed]
  9. treportunused.nim(59, 5) Hint: 'G' is declared but not used [XDeclaredButNotUsed]
  10. treportunused.nim(60, 5) Hint: 'H' is declared but not used [XDeclaredButNotUsed]
  11. treportunused.nim(64, 5) Hint: 'K' is declared but not used [XDeclaredButNotUsed]
  12. treportunused.nim(65, 5) Hint: 'L' is declared but not used [XDeclaredButNotUsed]
  13. treportunused.nim(31, 10) Hint: 's1' is declared but not used [XDeclaredButNotUsed]
  14. treportunused.nim(32, 10) Hint: 's2' is declared but not used [XDeclaredButNotUsed]
  15. treportunused.nim(33, 10) Hint: 's3' is declared but not used [XDeclaredButNotUsed]
  16. treportunused.nim(34, 6) Hint: 's4' is declared but not used [XDeclaredButNotUsed]
  17. treportunused.nim(35, 6) Hint: 's5' is declared but not used [XDeclaredButNotUsed]
  18. treportunused.nim(36, 7) Hint: 's6' is declared but not used [XDeclaredButNotUsed]
  19. treportunused.nim(37, 7) Hint: 's7' is declared but not used [XDeclaredButNotUsed]
  20. treportunused.nim(38, 5) Hint: 's8' is declared but not used [XDeclaredButNotUsed]
  21. treportunused.nim(39, 5) Hint: 's9' is declared but not used [XDeclaredButNotUsed]
  22. treportunused.nim(40, 6) Hint: 's10' is declared but not used [XDeclaredButNotUsed]
  23. treportunused.nim(41, 6) Hint: 's11' is declared but not used [XDeclaredButNotUsed]
  24. treportunused.nim(45, 3) Hint: 'v0.99' is declared but not used [XDeclaredButNotUsed]
  25. treportunused.nim(46, 3) Hint: 'v0.99.99' is declared but not used [XDeclaredButNotUsed]
  26. '''
  27. action: compile
  28. """
  29. # bug #9764
  30. iterator s1(a:string): int = discard
  31. iterator s2(): int = discard
  32. template s3(): untyped = 123
  33. proc s4(): int = 123
  34. proc s5[T](a: T): int = 123
  35. macro s6(a: int): untyped = discard
  36. const s7 = 0
  37. let s8 = 0
  38. var s9: int
  39. type s10 = object
  40. type s11 = type(1.2)
  41. # bug #14407 (requires `compiler/nim.cfg` containing define:nimPreviewFloatRoundtrip)
  42. let
  43. `v0.99` = "0.99"
  44. `v0.99.99` = "0.99.99"
  45. block: # bug #18201
  46. # Test that unused type aliases raise hint XDeclaredButNotUsed.
  47. type
  48. A = int
  49. B = distinct int
  50. C = object
  51. D = C
  52. E = distinct C
  53. F = string
  54. G = F
  55. H = distinct F
  56. J = enum
  57. Foo
  58. K = J
  59. L = distinct J