I suspect this is a bug, but I’d like a second opinion in case I’m doing something wrong.
Julia version:
Julia Version 1.1.1
Commit 55e36cc308 (2019-05-16 04:10 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i7-3820 CPU @ 3.60GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.1 (ORCJIT, sandybridge)
Environment:
JULIA_EDITOR = atom -a
JULIA_NUM_THREADS = 4
A simplified example:
struct Data{Symbol}
value::Int
end
mutable struct FunLike
value::Int
FunLike() = new(0)
end
function (f::FunLike)(x::Data{:a})
f.value += x.value
end
function (f::FunLike)(x::Data{:b})
f.value *= x.value
end
Now under REPL in Atom/Juno if you run:
t=FunLike()
@Juno.enter t(Data{:a}(2))
You end up stopped in sysimg.jl line 19:
setproperty!(x, f::Symbol, v) = setfield!(x, f, convert(fieldtype(typeof(x), f), v))
The correct function does execute, but I can’t for the life of me stop in that function. Or maybe creating multiple methods for a function like object is considered bad form?