Skip to content

Commit bc78ee6

Browse files
committed
Revert "Fix convert(::Type{<:StaticArray}, ::UniformScaling) (#759)"
This reverts commit f37b58e. As discussed in #759, `convert` semantics are problematic (convert should preserve `isequal` `isless`, and `hash`) so revert this for now.
1 parent f37b58e commit bc78ee6

File tree

2 files changed

+0
-8
lines changed

2 files changed

+0
-8
lines changed

src/linalg.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ end
102102
# because we do not have `SArray{Tuple{2,3}} <: StaticMatrix`.
103103
(::Type{SM})(I::UniformScaling) where {SM<:(StaticArray{Tuple{N,M}} where {N,M})} =
104104
_scalar_matrix(Size(SM), SM, I.λ)
105-
convert(T::Type{<:StaticArrayLike}, I::UniformScaling) = T(I)
106105

107106
# Construct a matrix with the scalar λ on the diagonal and zeros off the
108107
# diagonal. The matrix can be non-square.

test/linalg.jl

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,6 @@ using LinearAlgebra: checksquare
7575
@test @inferred(SDiagonal{3}(2.0I))::SDiagonal{3,Float64} == 2I3x3
7676
@test @inferred(SDiagonal{3,Float64}(I))::SDiagonal{3,Float64} == I3x3
7777
@test @inferred(SDiagonal{3,Float32}(2.0I))::SDiagonal{3,Float32} == 2I3x3
78-
79-
# convert from UniformScaling falls back to constructors
80-
@test @inferred(convert(SMatrix{2,2,Float64}, I)) === SA_F64[1 0; 0 1]
81-
@test @inferred(convert(MMatrix{2,2,Float64}, I))::MMatrix{2,2,Float64} == SA[1 0; 0 1]
82-
@test @inferred(convert(SMatrix{2,2}, I)) === SA{Bool}[1 0; 0 1]
83-
@test @inferred(convert(SArray{Tuple{2,2}}, I)) === SA{Bool}[1 0; 0 1]
84-
@test @inferred(convert(SDiagonal{2}, I)) === Diagonal{Bool,SArray{Tuple{2},Bool,1,2}}((1,1))
8578
end
8679

8780
@testset "diagm()" begin

0 commit comments

Comments
 (0)