JuliaVariables.jl icon indicating copy to clipboard operation
JuliaVariables.jl copied to clipboard

Fields of struct are treated as globals

Open tkf opened this issue 6 years ago • 2 comments

Hi, thanks for a super useful package. Unfortunately, I think I find a bug

julia> solve(:(struct S
           x
       end))
:(struct @global S
      #= REPL[11]:2 =#
      @global x
  end)

I suppose @global x is wrong?

tkf avatar Nov 01 '19 07:11 tkf

Yes, I didn't treat struct yet. A bit curious, Is this necessary? I think the scope of struct is simple so we can treat them separately.

thautwarm avatar Nov 01 '19 09:11 thautwarm

Yeah, I think I can skip fields while processing solved tree. But I thought it would be nice if I can just blindly look for ScopedVar.

tkf avatar Nov 01 '19 20:11 tkf