-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
syntax: local variable name "N" conflicts with a static parameter #32816
Comments
I'm guessing this could have been caused by #32623. Could you try locally reverting that commit? |
@tlienart Any update on this? |
@DilumAluthge since it requires building Julia from source, I haven't had the time to look into it yet |
I can confirm that reverting #32623 locally fixes this error. After reverting, I was able to successfully My branch with the revert is the branch For posterity, here is the output of
|
Thanks. It would really help to have a reduced case here. |
So, uh, I might have egg on my face for this one. The reason that this error is being thrown in MLJ version 0.2.5 is... well, the error message is correct in MLJ version 0.2.5. If you look at line 122 of https://github.com/alan-turing-institute/MLJ.jl/blob/v0.2.5/src/composites.jl , you'll see this: function Base.replace(W::Node, pairs::Pair...) where N And then on lines 149 through 151, inside that same method definition: nodes_ = filter(nodes(W)) do N
!(N isa Source)
end So the error is correct. Because we have I cloned the MLJ repo, checked out the The reason that @tlienart and I had such a hard time making an MWE is probably that we both were reading the source code of MLJ master. But, as you can see from looking at line 133 of https://github.com/alan-turing-institute/MLJ.jl/blob/master/src/composites.jl, the In fact, I tried adding @tlienart Are you able to reproduce this bug when adding If not, we can probably close this issue as "cannot reproduce when using MLJ master and Julia master." |
I managed to construct a reduced example for this: julia> function foo(x::N) where N
for N in x
println(N)
end
end
ERROR: syntax: local variable name "N" conflicts with a static parameter |
That seems like a correct error: you are not allowed to shadow a static parameter with a local. |
@DilumAluthge 's observations above suggest this is red herring. In any case the pkg triggering the original discussion (MLJ) passes tests on 1.0, 1.1., 1.2 and nightly. Think you can probably close this one. |
Version: Julia 1.3/alpha // MacOS
This may be related to #29429 and was observed here: JuliaAI/MLJ.jl#198
I couldn't write a barebone reproducing example so unfortunately I can only describe the bit that doesn't work (but should) and what fixes it:
The original code has:
which throws the error mentioned above; replacing these 3 lines with
nodes_ = filter(N -> !isa(N, Source) nodes(W))
(which should be identical as far as I'm aware) fixes the issue.Code works fine on 1.1, 1.2.
Edit: stacktrace
The text was updated successfully, but these errors were encountered: