This commit is contained in:
Timothee Cour
2018-12-27 13:40:09 -08:00
committed by Andreas Rumpf
parent 05b8085a87
commit 1b7c8482fe
3 changed files with 6 additions and 6 deletions

View File

@@ -174,7 +174,7 @@ proc ensureNoMissingOrUnusedSymbols(c: PContext; scope: PScope) =
# maybe they can be made skGenericParam as well.
if s.typ != nil and tfImplicitTypeParam notin s.typ.flags and
s.typ.kind != tyGenericParam:
message(c.config, s.info, hintXDeclaredButNotUsed, getSymRepr(c.config, s))
message(c.config, s.info, hintXDeclaredButNotUsed, s.name.s)
s = nextIter(it, scope.symbols)
proc wrongRedefinition*(c: PContext; info: TLineInfo, s: string;

View File

@@ -1,12 +1,12 @@
discard """
nimout: '''
treportunused.nim(19, 10) Hint: 'treportunused.s1(a: string)[declared in treportunused.nim(19, 9)]' is declared but not used [XDeclaredButNotUsed]
treportunused.nim(19, 10) Hint: 's1' is declared but not used [XDeclaredButNotUsed]
treportunused.nim(26, 5) Hint: 's8' is declared but not used [XDeclaredButNotUsed]
treportunused.nim(22, 6) Hint: 'treportunused.s4()[declared in treportunused.nim(22, 5)]' is declared but not used [XDeclaredButNotUsed]
treportunused.nim(22, 6) Hint: 's4' is declared but not used [XDeclaredButNotUsed]
treportunused.nim(25, 7) Hint: 's7' is declared but not used [XDeclaredButNotUsed]
treportunused.nim(24, 7) Hint: 's6' is declared but not used [XDeclaredButNotUsed]
treportunused.nim(23, 6) Hint: 'treportunused.s5(a: T)[declared in treportunused.nim(23, 5)]' is declared but not used [XDeclaredButNotUsed]
treportunused.nim(20, 10) Hint: 'treportunused.s2()[declared in treportunused.nim(20, 9)]' is declared but not used [XDeclaredButNotUsed]
treportunused.nim(23, 6) Hint: 's5' is declared but not used [XDeclaredButNotUsed]
treportunused.nim(20, 10) Hint: 's2' is declared but not used [XDeclaredButNotUsed]
treportunused.nim(29, 6) Hint: 's11' is declared but not used [XDeclaredButNotUsed]
treportunused.nim(27, 5) Hint: 's9' is declared but not used [XDeclaredButNotUsed]
treportunused.nim(21, 10) Hint: 's3' is declared but not used [XDeclaredButNotUsed]

View File

@@ -1,7 +1,7 @@
discard """
nimout: '''
compile start
tused.nim(17, 8) Hint: 'tused.echoSub(a: int, b: int)[declared in tused.nim(17, 7)]' is declared but not used [XDeclaredButNotUsed]
tused.nim(17, 8) Hint: 'echoSub' is declared but not used [XDeclaredButNotUsed]
compile end'''
output: "8\n8"
joinable: false