Traceur.jl icon indicating copy to clipboard operation
Traceur.jl copied to clipboard

@trace not updating with method redefinition

Open MasonProtter opened this issue 7 years ago • 2 comments

If one defines a method, uses @trace on that method and then redefines the method and runs @trace on it again, it will give the output from the old method definition, not the new one. This seems to be a pretty major bug.

julia> using Traceur

julia> foo() = -10.0:10.0
foo (generic function with 1 method)

julia> foo()
-10.0:1.0:10.0

julia> @trace foo()
-10.0:1.0:10.0

julia> foo() = -10:10
foo (generic function with 1 method)

julia> foo()
-10:10

julia> @trace foo()
-10.0:1.0:10.0

MasonProtter avatar Sep 06 '18 23:09 MasonProtter

I suspect that happens because of https://github.com/jrevels/Cassette.jl/issues/6, but it's definitely rather unfortunate.

pfitzseb avatar Sep 07 '18 07:09 pfitzseb

If ASTInterpreter and Vinyl can be upgraded to 1.0, it'd be better to switch back to them to avoid this. Cassette makes sense right now just because it works, but we don't really need this to be compiled.

MikeInnes avatar Sep 07 '18 10:09 MikeInnes