-
Notifications
You must be signed in to change notification settings - Fork 11
Description
Revise can get desynchronized from the file state by the following sequence of user actions:
- cut the definition of
foo(x::T)
fromfileA.jl
, but do not yet save the file - paste definition into
fileB.jl
(another file in the same package) and save the file - trigger a revision
- save
fileA.jl
and trigger a revision
After item 3, there are technically duplicated definitions of the method (and if the user had quit and rebuilt the package at this point s/he would get a precompile error). After item 4, Revise will helpfully delete the method, not realizing it had been duplicated. So attempts to use the method will henceforth fail.
I used to think of this as "user error" (the user should have saved fileA.jl
before triggering the first revision) but lately I've come to think it should be treated as a Revise bug. The question is how best to implement a fix. It seems the most thorough fix would involve making method_info
a sig=>list-of-definitions
dict rather than a sig=>definition
dict. If list-of-definitions
is a Vector
, though, there are going to be an awful lot of vectors with just one element. Any thoughts on a better way to do this?