Skip to content

Commit

Permalink
Fixed convert method
Browse files Browse the repository at this point in the history
  • Loading branch information
jonniedie committed Feb 28, 2022
1 parent 8d7352c commit 7e95379
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ComponentArrays"
uuid = "b0b7db55-cfe3-40fc-9ded-d10e2dbeff66"
authors = ["Jonnie Diegelman <[email protected]>"]
version = "0.11.9"
version = "0.11.10"

[deps]
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
Expand Down
2 changes: 1 addition & 1 deletion src/similar_convert_copy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ end
function Base.convert(::Type{ComponentArray{T1,N,A1,Ax1}}, x::ComponentArray{T2,N,A2,Ax2}) where {T1,T2,N,A1,A2,Ax1,Ax2}
return T1.(x)
end
Base.convert(::Type{<:Array}, x::ComponentArray) = convert(Array, getdata(x))
Base.convert(T::Type{<:Array}, x::ComponentArray) = convert(T, getdata(x))

Base.convert(::Type{Cholesky{T1,Matrix{T1}}}, x::Cholesky{T2,<:ComponentArray}) where {T1,T2} = Cholesky(Matrix{T1}(x.factors), x.uplo, x.info)

Expand Down
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ end
@test convert(typeof(cmat), cmat) == cmat

@test convert(Array, ca) == getdata(ca)
@test convert(Matrix{Float32}, cmat) isa Matrix{Float32}
end

@testset "Broadcasting" begin
Expand Down

2 comments on commit 7e95379

@jonniedie
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/55641

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.11.10 -m "<description of version>" 7e953791eca03996fce6c467d444ab47a3ff4af3
git push origin v0.11.10

Please sign in to comment.