feature: the compiler can warn when you use the implicit 'result' variable (#17988) [backport:1.2]
* implements #17855
This commit is contained in:
parent
a9ae5fe5be
commit
378ee7f888
3 changed files with 7 additions and 2 deletions
|
|
@ -1246,6 +1246,9 @@ proc semSym(c: PContext, n: PNode, sym: PSym, flags: TExprFlags): PNode =
|
|||
# not sure the symbol really ends up being used:
|
||||
# var len = 0 # but won't be called
|
||||
# genericThatUsesLen(x) # marked as taking a closure?
|
||||
if hasWarn(c.config, warnResultUsed):
|
||||
message(c.config, n.info, warnResultUsed)
|
||||
|
||||
of skGenericParam:
|
||||
onUse(n.info, s)
|
||||
if s.typ.kind == tyStatic:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue