Unexpected type instability with getproperty but not setproperty!

Constant propagation doesn’t really work with recursion. Use:

function Base.getproperty(e::Entry, s::Symbol)
    if s === :value
        getfield(e, :data)[getfield(e, :id)]
    else
        getfield(e, s)
    end
end
7 Likes