Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XDeclaredButNotUsed doesn't work with template, let/var/const, type; works with all other routine nodes #9764

Closed
timotheecour opened this issue Nov 20, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@timotheecour
Copy link
Contributor

commented Nov 20, 2018

  • s3 should be listed in XDeclaredButNotUsed hints
  • likewise with s7,s8,s9
  • likewise with s10,s11
iterator s1(a:string): int = discard
iterator s2(): int = discard
template s3(): untyped = 123
proc s4(): int = 123
proc s5[T](a: T): int = 123
macro s6(a: int): untyped = discard
const s7 = 0
let s8 = 0
var s9: int
type s10 = object
type s11 = type(1.2)

rnim --hint:XDeclaredButNotUsed:on $timn_D/bugs/all/t0007.nim
nim c --nimcache:/tmp/nim//nimcache/ -o:/tmp/nim//app -r --hint:XDeclaredButNotUsed:on /Users/timothee/git_clone//nim//timn//bugs/all/t0007.nim

/Users/timothee/git_clone/nim/timn/bugs/all/t0007.nim(17, 10) Hint: 't0007.s1(a: string)[declared in t0007.nim(17, 9)]' is declared but not used [XDeclaredButNotUsed]
  iterator s1(a:string): int = discard
           ^
/Users/timothee/git_clone/nim/timn/bugs/all/t0007.nim(20, 6) Hint: 't0007.s4()[declared in t0007.nim(20, 5)]' is declared but not used [XDeclaredButNotUsed]
  proc s4(): int = 123
       ^
/Users/timothee/git_clone/nim/timn/bugs/all/t0007.nim(22, 7) Hint: 's6' is declared but not used [XDeclaredButNotUsed]
  macro s6(a: int): untyped = discard
        ^
/Users/timothee/git_clone/nim/timn/bugs/all/t0007.nim(21, 6) Hint: 't0007.s5(a: T)[declared in t0007.nim(21, 5)]' is declared but not used [XDeclaredButNotUsed]
  proc s5[T](a: T): int = 123
       ^
/Users/timothee/git_clone/nim/timn/bugs/all/t0007.nim(18, 10) Hint: 't0007.s2()[declared in t0007.nim(18, 9)]' is declared but not used [XDeclaredButNotUsed]
  iterator s2(): int = discard
           ^

@timotheecour timotheecour changed the title XDeclaredButNotUsed doesn't work with template, let/var/const; works with all other routine nodes XDeclaredButNotUsed doesn't work with template, let/var/const, type; works with all other routine nodes Nov 20, 2018

@Araq Araq closed this in 610283b Nov 23, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.