Skip to content

Commit 92c78e2

Browse files
authored
Remove show(::IO, ::Type{StaticArrays.Blah}) overloads (#769)
Apparently these can be problematic for compiler-internal reasons, and simplified printing of types without an explicit module qualifier has existed in Base for a while. So let's just remove these show overloads.
1 parent 53b4a0e commit 92c78e2

File tree

7 files changed

+0
-18
lines changed

7 files changed

+0
-18
lines changed

src/MMatrix.jl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@ end
5454
@inline convert(::Type{MMatrix{S1,S2}}, a::StaticArray{<:Tuple, T}) where {S1,S2,T} = MMatrix{S1,S2,T}(Tuple(a))
5555
@inline MMatrix(a::StaticMatrix) = MMatrix{size(typeof(a),1),size(typeof(a),2)}(Tuple(a))
5656

57-
# Simplified show for the type
58-
#show(io::IO, ::Type{MMatrix{N, M, T}}) where {N, M, T} = print(io, "MMatrix{$N,$M,$T}")
59-
6057
# Some more advanced constructor-like functions
6158
@inline one(::Type{MMatrix{N}}) where {N} = one(MMatrix{N,N})
6259

src/MVector.jl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ const MVector{S, T} = MArray{Tuple{S}, T, 1, S}
2020
@inline MVector{S}(x::NTuple{S,T}) where {S, T} = MVector{S, T}(x)
2121
@inline MVector{S}(x::NTuple{S,Any}) where {S} = MVector{S, promote_tuple_eltype(typeof(x))}(x)
2222

23-
# Simplified show for the type
24-
#show(io::IO, ::Type{MVector{N, T}}) where {N, T} = print(io, "MVector{$N,$T}")
25-
2623
# Some more advanced constructor-like functions
2724
@inline zeros(::Type{MVector{N}}) where {N} = zeros(MVector{N,Float64})
2825
@inline ones(::Type{MVector{N}}) where {N} = ones(MVector{N,Float64})

src/SMatrix.jl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ end
5555
@inline convert(::Type{SMatrix{S1,S2}}, a::StaticArray{<:Tuple, T}) where {S1,S2,T} = SMatrix{S1,S2,T}(Tuple(a))
5656
@inline SMatrix(a::StaticMatrix{S1, S2}) where {S1, S2} = SMatrix{S1, S2}(Tuple(a))
5757

58-
# Simplified show for the type
59-
# show(io::IO, ::Type{SMatrix{N, M, T}}) where {N, M, T} = print(io, "SMatrix{$N,$M,$T}") # TODO reinstate
60-
6158
# Some more advanced constructor-like functions
6259
@inline one(::Type{SMatrix{N}}) where {N} = one(SMatrix{N,N})
6360

src/SUnitRange.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ end
2626
end
2727

2828
# Shorten show for REPL use.
29-
show(io::IO, ::Type{SUnitRange}) = print(io, "SUnitRange")
3029
function show(io::IO, ::MIME"text/plain", ::SUnitRange{Start, L}) where {Start, L}
3130
print(io, "SUnitRange($Start,$(Start + L - 1))")
3231
end

src/SVector.jl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ const SVector{S, T} = SArray{Tuple{S}, T, 1, S}
2222
# conversion from AbstractVector / AbstractArray (better inference than default)
2323
#@inline convert{S,T}(::Type{SVector{S}}, a::AbstractArray{T}) = SVector{S,T}((a...))
2424

25-
# Simplified show for the type
26-
# show(io::IO, ::Type{SVector{N, T}}) where {N, T} = print(io, "SVector{$N,$T}") # TODO reinstate
27-
2825
# Some more advanced constructor-like functions
2926
@inline zeros(::Type{SVector{N}}) where {N} = zeros(SVector{N,Float64})
3027
@inline ones(::Type{SVector{N}}) where {N} = ones(SVector{N,Float64})

src/Scalar.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,3 @@ end
2424
# A lot more compact than the default array show
2525
Base.show(io::IO, ::MIME"text/plain", x::Scalar{T}) where {T} = print(io, "Scalar{$T}(", x.data, ")")
2626

27-
# Simplified show for the type
28-
show(io::IO, ::Type{Scalar{T}}) where {T} = print(io, "Scalar{T}")

test/SUnitRange.jl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,4 @@
1010

1111
@test_throws Exception StaticArrays.SUnitRange{1, -1}()
1212
@test_throws TypeError StaticArrays.SUnitRange{1, 1.5}()
13-
14-
ur_str = sprint(show, StaticArrays.SUnitRange)
15-
@test ur_str == "SUnitRange"
1613
end

0 commit comments

Comments
 (0)