don't warn for symbols hidden in macros
This commit is contained in:
parent
284983657f
commit
45ab692db4
@ -84,7 +84,7 @@ the `file.diagnostics` field, filling it with diagnostics."
|
||||
:codeDescription "bad-unpack"})))
|
||||
|
||||
(λ var-never-set [self file symbol definition]
|
||||
(if (and definition.var? (not definition.var-set))
|
||||
(if (and definition.var? (not definition.var-set) (. file.lexical symbol))
|
||||
{:range (message.ast->range self file symbol)
|
||||
:message (.. "var is never set: " (tostring symbol) " Consider using (local) instead of (var)")
|
||||
:severity message.severity.WARN
|
||||
|
||||
@ -168,9 +168,8 @@
|
||||
|
||||
(check "(var x 1) (set x 2) (print x)"
|
||||
[] [{}])
|
||||
;; TODO fix diagnostic
|
||||
; (check "(local x 10) (?. x)"
|
||||
; [] [{:code 305}])
|
||||
(check "(local x 10) (?. x)"
|
||||
[] [{:code 305}])
|
||||
nil)
|
||||
|
||||
;; missing test for 306
|
||||
|
||||
Loading…
Reference in New Issue
Block a user