Skip to content

Remove some spurious where T from SA constructors #665

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

Merged
merged 1 commit into from
Sep 27, 2019
Merged
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
8 changes: 4 additions & 4 deletions src/initializers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ const SA_F64 = SA{Float64}
Base.@pure _SA_type(sa::Type{SA}, len::Int) = SVector{len}
Base.@pure _SA_type(sa::Type{SA{T}}, len::Int) where {T} = SVector{len,T}

@inline Base.getindex(sa::Type{<:SA}, xs...) where T = similar_type(sa, Size(length(xs)))(xs)
@inline Base.typed_vcat(sa::Type{<:SA}, xs::Number...) where T = similar_type(sa, Size(length(xs)))(xs)
@inline Base.typed_hcat(sa::Type{<:SA}, xs::Number...) where T = similar_type(sa, Size(1,length(xs)))(xs)
@inline Base.getindex(sa::Type{<:SA}, xs...) = similar_type(sa, Size(length(xs)))(xs)
@inline Base.typed_vcat(sa::Type{<:SA}, xs::Number...) = similar_type(sa, Size(length(xs)))(xs)
@inline Base.typed_hcat(sa::Type{<:SA}, xs::Number...) = similar_type(sa, Size(1,length(xs)))(xs)

Base.@pure function _SA_hvcat_transposed_size(rows)
M = rows[1]
Expand All @@ -43,7 +43,7 @@ Base.@pure function _SA_hvcat_transposed_size(rows)
Size(M, length(rows))
end

@inline function Base.typed_hvcat(sa::Type{<:SA}, rows::Dims, xs::Number...) where T
@inline function Base.typed_hvcat(sa::Type{<:SA}, rows::Dims, xs::Number...)
msize = _SA_hvcat_transposed_size(rows)
if msize === nothing
throw(ArgumentError("SA[...] matrix rows of length $rows are inconsistent"))
Expand Down