You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Below are two MWEs to provoke wrong linter outputs related to (wrongly claimed) undefined variables in @eval blocks. They may or may not have the same source.
UnusedBinding
The following example provokes the linter report Variable has been assigned but not used.Julia(UnusedBinding).
module Example
@evalbeginfunctionfoo(i)
x = i # UnusedBinding warning for x here
x
endendend
InvalidRedefofConst
The following more involved example provokes the linter report Invalid redefinition of constant.Julia(InvalidRedefofConst). Note that the following peculiarities are necessary for the situation to appear:
The struct needs to have the type parameter.
The constructor must be defined.
module Example
struct Foo{T}
a::TfunctionFoo(a::T) where T
new{T}(a)
endend@evalbeginfunctionfoo(i) # InvalidRedefofConst warning for i hereFoo(i)
endendend
Below are two MWEs to provoke wrong linter outputs related to (wrongly claimed) undefined variables in
@eval
blocks. They may or may not have the same source.UnusedBinding
The following example provokes the linter report
Variable has been assigned but not used.Julia(UnusedBinding)
.InvalidRedefofConst
The following more involved example provokes the linter report
Invalid redefinition of constant.Julia(InvalidRedefofConst)
. Note that the following peculiarities are necessary for the situation to appear:x-ref #2601 #3171
The text was updated successfully, but these errors were encountered: