thautwarm / Virtual.jl

MIT License
41 stars 1 forks source link

error: `setfield!` should not be changed #3

Closed Moelf closed 2 years ago

Moelf commented 2 years ago
[ Info: Precompiling Geom4hep [eb5d0804-93e0-431a-a4d4-b4f95b95575a]
ERROR: LoadError: setfield! fields of Types should not be changed
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] setproperty!(x::Type, f::Symbol, v::Symbol)
    @ Base ./Base.jl:34
  [3] parse_function_header!(ln::LineNumberNode, self::Virtual.FuncInfo, header::Expr; is_lambda::Bool, allow_lambda::Bool)
    @ Virtual C:\Users\twshe\Desktop\Git\Virtual\src\reflection.jl:230
  [4] parse_function(ln::LineNumberNode, ex::Expr; fallback::Virtual.Undefined, allow_short_func::Bool, allow_lambda::Bool)
    @ Virtual C:\Users\twshe\Desktop\Git\Virtual\src\reflection.jl:186
  [5] var"@override"(__source__::LineNumberNode, __module__::Module, func_def::Any)
    @ Virtual ~/.julia/packages/Virtual/OLENd/src/Virtual.jl:256
  [6] include(mod::Module, _path::String)
    @ Base ./Base.jl:419
  [7] include(x::String)
    @ Geom4hep ~/Documents/github/Geom4hep/src/Geom4hep.jl:1

is this problem of how I'm using the package or Virtual.jl doesn't work on 1.8?

thautwarm commented 2 years ago

Oh, it's just a bug at the utility function. It has a known fix: https://github.com/Suzhou-Tongyuan/ObjectOriented.jl/pull/6

Moelf commented 2 years ago

How do we fix here?

Moelf commented 2 years ago

actually that PR doesn't fix my issue, not sure why