Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove show(::IO, ::Type{StaticArrays.Blah}) overloads #769

Merged
merged 1 commit into from
Apr 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/MMatrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ end
@inline convert(::Type{MMatrix{S1,S2}}, a::StaticArray{<:Tuple, T}) where {S1,S2,T} = MMatrix{S1,S2,T}(Tuple(a))
@inline MMatrix(a::StaticMatrix) = MMatrix{size(typeof(a),1),size(typeof(a),2)}(Tuple(a))

# Simplified show for the type
#show(io::IO, ::Type{MMatrix{N, M, T}}) where {N, M, T} = print(io, "MMatrix{$N,$M,$T}")

# Some more advanced constructor-like functions
@inline one(::Type{MMatrix{N}}) where {N} = one(MMatrix{N,N})

Expand Down
3 changes: 0 additions & 3 deletions src/MVector.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ const MVector{S, T} = MArray{Tuple{S}, T, 1, S}
@inline MVector{S}(x::NTuple{S,T}) where {S, T} = MVector{S, T}(x)
@inline MVector{S}(x::NTuple{S,Any}) where {S} = MVector{S, promote_tuple_eltype(typeof(x))}(x)

# Simplified show for the type
#show(io::IO, ::Type{MVector{N, T}}) where {N, T} = print(io, "MVector{$N,$T}")

# Some more advanced constructor-like functions
@inline zeros(::Type{MVector{N}}) where {N} = zeros(MVector{N,Float64})
@inline ones(::Type{MVector{N}}) where {N} = ones(MVector{N,Float64})
Expand Down
3 changes: 0 additions & 3 deletions src/SMatrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ end
@inline convert(::Type{SMatrix{S1,S2}}, a::StaticArray{<:Tuple, T}) where {S1,S2,T} = SMatrix{S1,S2,T}(Tuple(a))
@inline SMatrix(a::StaticMatrix{S1, S2}) where {S1, S2} = SMatrix{S1, S2}(Tuple(a))

# Simplified show for the type
# show(io::IO, ::Type{SMatrix{N, M, T}}) where {N, M, T} = print(io, "SMatrix{$N,$M,$T}") # TODO reinstate

# Some more advanced constructor-like functions
@inline one(::Type{SMatrix{N}}) where {N} = one(SMatrix{N,N})

Expand Down
1 change: 0 additions & 1 deletion src/SUnitRange.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ end
end

# Shorten show for REPL use.
show(io::IO, ::Type{SUnitRange}) = print(io, "SUnitRange")
function show(io::IO, ::MIME"text/plain", ::SUnitRange{Start, L}) where {Start, L}
print(io, "SUnitRange($Start,$(Start + L - 1))")
end
3 changes: 0 additions & 3 deletions src/SVector.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ const SVector{S, T} = SArray{Tuple{S}, T, 1, S}
# conversion from AbstractVector / AbstractArray (better inference than default)
#@inline convert{S,T}(::Type{SVector{S}}, a::AbstractArray{T}) = SVector{S,T}((a...))

# Simplified show for the type
# show(io::IO, ::Type{SVector{N, T}}) where {N, T} = print(io, "SVector{$N,$T}") # TODO reinstate

# Some more advanced constructor-like functions
@inline zeros(::Type{SVector{N}}) where {N} = zeros(SVector{N,Float64})
@inline ones(::Type{SVector{N}}) where {N} = ones(SVector{N,Float64})
Expand Down
2 changes: 0 additions & 2 deletions src/Scalar.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,3 @@ end
# A lot more compact than the default array show
Base.show(io::IO, ::MIME"text/plain", x::Scalar{T}) where {T} = print(io, "Scalar{$T}(", x.data, ")")

# Simplified show for the type
show(io::IO, ::Type{Scalar{T}}) where {T} = print(io, "Scalar{T}")
3 changes: 0 additions & 3 deletions test/SUnitRange.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,4 @@

@test_throws Exception StaticArrays.SUnitRange{1, -1}()
@test_throws TypeError StaticArrays.SUnitRange{1, 1.5}()

ur_str = sprint(show, StaticArrays.SUnitRange)
@test ur_str == "SUnitRange"
end