Help to remove type instability

You probably need to use a type parameter for the field holding the function as Function is abstract. Same goes for Tuple:

mutable struct Object{F<:Function, T<:Tuple}
    on_return_pressed::F
    vargs_on_return_pressed::T
end

Edit: But note, that with this approach compile time will go up as new JITting needs to happen for all different F and T. This application seems like it might be better off with a type-instability.

1 Like