File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 875
875
876
876
function check_unused_binding (b:: Binding , scope:: Scope )
877
877
if headof (scope. expr) != = :struct && headof (scope. expr) != = :tuple && ! all_underscore (valof (b. name))
878
- if (isempty (b. refs) || length (b. refs) == 1 && b. refs[1 ] == b. name) && ! is_sig_arg (b. name) && ! is_overwritten_in_loop (b. name) && ! is_overwritten_subsequently (b, scope)
879
- seterror! (b. name, UnusedBinding)
878
+ refs = loose_refs (b)
879
+ if (isempty (refs) || length (refs) == 1 && refs[1 ] == b. name) && ! is_sig_arg (b. name) && ! is_overwritten_in_loop (b. name) && ! is_overwritten_subsequently (b, scope)
880
+ seterror! (b. name, UnusedBinding)
880
881
end
881
882
end
882
883
end
Original file line number Diff line number Diff line change @@ -323,8 +323,11 @@ mutable struct LooseRefs
323
323
end
324
324
325
325
function (state:: LooseRefs )(x:: EXPR )
326
- if hasbinding (x) && valofid (bindingof (x). name) == state. name
327
- push! (state. result, bindingof (x))
326
+ if hasbinding (x)
327
+ ex = bindingof (x). name
328
+ if isidentifier (ex) && valofid (ex) == state. name
329
+ push! (state. result, bindingof (x))
330
+ end
328
331
end
329
332
if ! hasscope (x) || (hasscope (x) && ((is_soft_scope (scopeof (x)) && ! scopehasbinding (scopeof (x), state. name)) || scopeof (x) == state. scope))
330
333
traverse (x, state)
You can’t perform that action at this time.
0 commit comments