FluxML / MacroTools.jl

MacroTools provides a library of tools for working with Julia code and expressions.
https://fluxml.ai/MacroTools.jl/stable/
Other
308 stars 77 forks source link

Hygiene issue detected by JET.jl #205

Open MilesCranmer opened 2 days ago

MilesCranmer commented 2 days ago

Just a heads up (no MWE) some JET issues in my package led back to MacroTools. This might just be an issue in Base but I thought I'd share in case you recognize any potential issues from it:

  ││┌ splitdef(fdef::Any) @ MacroTools /Users/mcranmer/.julia/packages/MacroTools/Cf2ok/src/match/macro.jl:67
  │││┌ longdef1(ex::Any) @ MacroTools /Users/mcranmer/.julia/packages/MacroTools/Cf2ok/src/utils.jl:263
  ││││┌ isshortdef(ex::Any) @ MacroTools /Users/mcranmer/.julia/packages/MacroTools/Cf2ok/src/match/macro.jl:67
  │││││┌ trymatch(pat::MacroTools.OrBind, ex::Any) @ MacroTools /Users/mcranmer/.julia/packages/MacroTools/Cf2ok/src/match/match.jl:113
  ││││││┌ match(pat::MacroTools.OrBind, ex::Any) @ MacroTools /Users/mcranmer/.julia/packages/MacroTools/Cf2ok/src/match/match.jl:108
  │││││││┌ match(pat::MacroTools.OrBind, ex::Any, env::Dict{Any, Any}) @ MacroTools /Users/mcranmer/.julia/packages/MacroTools/Cf2ok/src/match/match.jl:105
  ││││││││┌ match_inner(pat::MacroTools.OrBind, ex::Any, env::Dict{Any, Any}) @ MacroTools /Users/mcranmer/.julia/packages/MacroTools/Cf2ok/src/match/union.jl:11
  │││││││││┌ merge!(d::Dict{Any, Any}, other::DataStructures.PriorityQueue) @ DataStructures /Users/mcranmer/.julia/packages/DataStructures/95DJa/src/priorityqueue.jl:361
  ││││││││││┌ not_iterator_of_pairs(kv::DataStructures.PriorityQueue) @ DataStructures /Users/mcranmer/.julia/packages/DataStructures/95DJa/src/dict_support.jl:6
  │││││││││││┌ any(f::DataStructures.var"#61#63"{…} where {…}, a::Vector{…}) @ Base ./reducedim.jl:1020
  ││││││││││││┌ any(f::DataStructures.var"#61#63"{…} where {…}, a::Vector{…}; dims::Colon) @ Base ./reducedim.jl:1020
  │││││││││││││┌ _any(f::DataStructures.var"#61#63"{…} where {…}, itr::Vector{…}, ::Colon) @ Base ./reduce.jl:1220
  ││││││││││││││┌ (::DataStructures.var"#61#63"{DataStructures.PriorityQueue{…}} where {K, V, O<:Base.Order.Ordering})(x::typeof(iterate)) @ DataStructures /Users/mcranmer/.julia/packages/DataStructures/95DJa/src/dict_support.jl:6
  │││││││││││││││┌ methodswith(t::Type{…} where {…}, f::typeof(iterate), meths::Bool) @ InteractiveUtils /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/usr/share/julia/stdlib/v1.10/InteractiveUtils/src/InteractiveUtils.jl:207
  ││││││││││││││││┌ methodswith(t::Type{…} where {…}, f::typeof(iterate), meths::Bool; supertypes::Bool) @ InteractiveUtils /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/usr/share/julia/stdlib/v1.10/InteractiveUtils/src/InteractiveUtils.jl:218
  │││││││││││││││││ no matching method found `push!(::Bool, ::Method)`: InteractiveUtils.push!(meths::Bool, d::Method)
  ││││││││││││││││└────────────────────
cstjean commented 2 days ago

Yeah, see also https://github.com/FluxML/MacroTools.jl/pull/159. Now that JET is well established, I would be happy to merge a PR fixing these issues.