-
Notifications
You must be signed in to change notification settings - Fork 114
Description
I have been playing around with https://github.com/MilesCranmer/DispatchDoctor.jl/ (v0.4.2) and found it quite useful. It also seems to work well with Revise.includet:
shell> cat test.jl
@stable f(x) = x == 1 ? 1 : 1.0
julia> Revise.includet("/Users/thofma/test2.jl")
julia> f(1)
ERROR: TypeInstabilityError: Instability detected in `f` defined at test.jl:1 with arguments `(Int64,)`. Inferred to be `Union{Float64, Int64}`, which is not a concrete type.
If I then change test.jl, i.e. change f from unstable -> stable, things are properly revised (even changing f from unstable -> unstable works.)
But it does not seem to work well within a module. If I have a module with the following content:
module A
using DispatchDoctor
include("test.jl")
end
Now if I do using Revise, A etc, and change f from unstable -> unstable, the error is not reported anymore.
As far as I understand, DispatchDoctor.jl replaces A.include with https://github.com/MilesCranmer/DispatchDoctor.jl/blob/569aac2fc3a904aa6e499a6a0b406aaa3a3ed849/src/stabilization.jl#L196-L205, and it seems this does not work properly in connection with Revise.
I am not sure how realistic it is to have both packages work nicely together. So feel free to close this issue, if it is technically not possible.
CC: @MilesCranmer