Skip to content

syntax: local variable name "N" conflicts with a static parameter #32816

Closed
@tlienart

Description

@tlienart

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:

nodes_ = filter(nodes(W)) do N
    !(N isa Source)
end

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

[ Info: Precompiling MLJ [add582a8-e3ab-11e8-2d5e-e98b27df1bc7]
ERROR: LoadError: LoadError: syntax: local variable name "N" conflicts with a static parameter
Stacktrace:
 [1] top-level scope at /Users/tlienart/.julia/packages/MLJ/XYSFt/src/composites.jl:113
 [2] include at ./boot.jl:328 [inlined]
 [3] include_relative(::Module, ::String) at ./loading.jl:1094
 [4] include at ./Base.jl:31 [inlined]
 [5] include(::String) at /Users/tlienart/.julia/packages/MLJ/XYSFt/src/MLJ.jl:1
 [6] top-level scope at /Users/tlienart/.julia/packages/MLJ/XYSFt/src/MLJ.jl:88
 [7] include at ./boot.jl:328 [inlined]
 [8] include_relative(::Module, ::String) at ./loading.jl:1094
 [9] include(::Module, ::String) at ./Base.jl:31
 [10] top-level scope at none:2
 [11] eval at ./boot.jl:330 [inlined]
 [12] eval(::Expr) at ./client.jl:433
 [13] top-level scope at ./none:3
in expression starting at /Users/tlienart/.julia/packages/MLJ/XYSFt/src/composites.jl:113
in expression starting at /Users/tlienart/.julia/packages/MLJ/XYSFt/src/MLJ.jl:88
ERROR: Failed to precompile MLJ [add582a8-e3ab-11e8-2d5e-e98b27df1bc7] to /Users/tlienart/.julia/compiled/v1.3/MLJ/rAU56.ji.
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1253
 [3] _require(::Base.PkgId) at ./loading.jl:1013
 [4] require(::Base.PkgId) at ./loading.jl:911
 [5] require(::Module, ::Symbol) at ./loading.jl:906

Metadata

Metadata

Assignees

Labels

bugIndicates an unexpected problem or unintended behaviorcompiler:loweringSyntax lowering (compiler front end, 2nd stage)

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions