@@ -3,9 +3,11 @@ isdefined(Base, :get_extension) ? (using StaticArrays) : (using ..StaticArrays)
33using Accessors
44import Accessors: setindex, delete, insert
55
6- @inline setindex (a:: StaticArray , args... ) = Base. setindex (a, args... )
6+ @inline setindex (a:: StaticArray{<:Any,ET} , v:: T , I... ) where {ET,T} = Base. setindex (similar_type (typeof (a), promote_type (ET, T))(a), v, I... )
7+ @inline setindex (a:: StaticArray{<:Any,T} , v:: T , I... ) where {T} = Base. setindex (a, v, I... )
78@inline delete (obj:: StaticVector , l:: IndexLens ) = StaticArrays. deleteat (obj, only (l. indices))
8- @inline insert (obj:: StaticVector , l:: IndexLens , val) = StaticArrays. insert (obj, only (l. indices), val)
9+ @inline insert (obj:: StaticVector{<:Any,ET} , l:: IndexLens , val:: T ) where {ET,T} = StaticArrays. insert (similar_type (typeof (obj), promote_type (ET, T))(obj), only (l. indices), val)
10+ @inline insert (obj:: StaticVector{<:Any,T} , l:: IndexLens , val:: T ) where {T} = StaticArrays. insert (obj, only (l. indices), val)
911
1012Accessors. set (obj:: StaticVector , :: Type{Tuple} , val:: Tuple ) = constructorof (typeof (obj))(val... )
1113Accessors. set (obj:: Tuple , :: Type{<:StaticVector} , val:: StaticVector ) = Tuple (val)
0 commit comments