Skip to content

Commit

Permalink
Merge pull request #326 from rdeits/fix-fsa-convert
Browse files Browse the repository at this point in the history
remove a broken convert() method and test that it was unnecessary
  • Loading branch information
c42f authored Oct 24, 2017
2 parents 11f371d + 992a4a2 commit 715fefe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/FixedSizeArrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ macro fixed_vector(name, parent)
end
@inline Base.Tuple(v::$(name)) = v.data
@inline Base.convert(::Type{$(name){S, T}}, x::NTuple{S, T}) where {S, T} = $(name){S, T}(x)
@inline Base.convert(::Type{$(name)}, x::StaticVector) = SV(x)
@inline function Base.convert(::Type{$(name){S, T}}, x::Tuple) where {S, T}
$(name){S, T}(convert(NTuple{S, T}, x))
end
Expand Down
3 changes: 3 additions & 0 deletions test/fixed_size_arrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ for N = (1, 10)
# from other FSA without parameters
v2 = VT2(v1)

# No-op conversion to same type without parameters
@test convert(VT, v1) === v1

@test typeof(v2) == VT2{N, ET}
@test length(v2) == N
@test eltype(v2) == ET
Expand Down

0 comments on commit 715fefe

Please sign in to comment.