Skip to content

Commit 1949618

Browse files
committed
Don't convert on invoked accessors
As all other manipulation functions for IdDict don't convert, it's best to be consistent and catch errors when we detect a mismatch.
1 parent 6a2e303 commit 1949618

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,5 +400,5 @@ getpkgid(uuid::UUID, libname) = PkgId(uuid, libname)
400400
# callers vulnerable to invalidation. These convenience utilities allow callers to insulate
401401
# themselves from invalidation. These are used by Revise.
402402
# example package triggering invalidation: StaticArrays (new `convert(Type{Array{T,N}}, ::AbstractArray)` methods)
403-
invoked_setindex!(dct::IdDict{K,V}, @nospecialize(val), @nospecialize(key)) where {K,V} = Base.invokelatest(setindex!, dct, val, convert(K, key))::typeof(dct)
404-
invoked_get!(::Type{T}, dct::IdDict{K,V}, @nospecialize(key)) where {K,V,T<:V} = Base.invokelatest(get!, T, dct, convert(K, key))::V
403+
invoked_setindex!(dct::IdDict{K,V}, @nospecialize(val), @nospecialize(key)) where {K,V} = Base.invokelatest(setindex!, dct, val, key)::typeof(dct)
404+
invoked_get!(::Type{T}, dct::IdDict{K,V}, @nospecialize(key)) where {K,V,T<:V} = Base.invokelatest(get!, T, dct, key)::V

0 commit comments

Comments
 (0)