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

LinearMaps 3.0: Incompatibility with StaticArrays due to generic _cat #123

Closed
mfherbst opened this issue Dec 11, 2020 · 2 comments · Fixed by #124
Closed

LinearMaps 3.0: Incompatibility with StaticArrays due to generic _cat #123

mfherbst opened this issue Dec 11, 2020 · 2 comments · Fixed by #124

Comments

@mfherbst
Copy link

mfherbst commented Dec 11, 2020

I observed the issue when using LinearMaps and StaticArrays at the same time. Could be more general and effect other generic Array types as well, but I have not tested.

Reproducer

Works fine:

using LinearMaps
using StaticArrays
rotations = [ones(3,3), ones(3,3)]
cat(rotations..., dims=3)

Not working any more with LinearMaps 3.0:

using LinearMaps
using StaticArrays
rotations = SMatrix{3,3,Float64}[ones(3,3), ones(3,3)]
cat(rotations..., dims=3)

Stacktrace:

ERROR: TypeError: in typeassert, expected Tuple{Int64,Int64}, got a value of type Int64
Stacktrace:
 [1] _cat(::Int64, ::SArray{Tuple{3,3},Float64,2,9}, ::Vararg{SArray{Tuple{3,3},Float64,2,9},N} where N) at /packages/LinearMaps/OwJoG/src/blockmap.jl:455
 [2] cat(::SArray{Tuple{3,3},Float64,2,9}, ::Vararg{SArray{Tuple{3,3},Float64,2,9},N} where N; dims::Int64) at ./abstractarray.jl:1654
 [3] top-level scope at REPL[19]:1
@dkarrasch
Copy link
Member

Thanks for reporting this. I guess I'll need to revert that _cat overload then. Tricky concatenation business.

@mfherbst
Copy link
Author

Thanks for your quick reply ... yes patching these sort of things in Base is always a bit tricky.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants