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

hvcat type piracy breaks Manifolds.jl on Julia 1.10 #219

Closed
mateuszbaran opened this issue Oct 9, 2023 · 6 comments
Closed

hvcat type piracy breaks Manifolds.jl on Julia 1.10 #219

mateuszbaran opened this issue Oct 9, 2023 · 6 comments

Comments

@mateuszbaran
Copy link

Resolving #214 uncovered another issue:

  MethodError: hvcat(::Tuple{Int64, Int64}, ::UniformScaling{Bool}, ::Matrix{Float64}, ::Matrix{Float64}, ::UniformScaling{Bool}) is ambiguous.
  
  Candidates:
    hvcat(rows::Tuple{Vararg{Int64}}, As::Union{AbstractArray, LinearAlgebra.AbstractQ, UniformScaling, LinearMaps.LinearMap}...)
      @ LinearMaps ~/.julia/packages/LinearMaps/6ej60/src/blockmap.jl:165
    hvcat(rows::Tuple{Vararg{Int64}}, A::Union{Number, AbstractArray, UniformScaling}...)
      @ LinearAlgebra ~/hostedtoolcache/julia/1.10.0-beta3/x64/share/julia/stdlib/v1.10/LinearAlgebra/src/uniformscaling.jl:447
  
  Possible fix, define
    hvcat(::Tuple{Vararg{Int64}}, ::Vararg{Union{AbstractArray, UniformScaling}})

See here for CI log: https://github.com/JuliaManifolds/Manifolds.jl/actions/runs/6453880959/job/17518302750?pr=648 .

@dkarrasch
Copy link
Member

That is because JuliaLang/julia#51132 hasn't been backported yet. Can you please check on nightly if the issue is present there?

@mateuszbaran
Copy link
Author

I've recently stopped running tests of Manifolds.jl on nightly because it fails too often. I'll wait for the next prerelease of Julia then.

@dkarrasch
Copy link
Member

Sure, or test the failing test locally, not the entire test suite.

@baggepinnen
Copy link

This has broken a lot of functionality in the control-systems packages as well. Aren't methods like this one

Base.vcat(As::Union{LinearMap, UniformScaling, AbstractArray, AbstractQ}...)

super piracy?

I expect this to work

julia> [randn(1,1) I; I randn(1,1)]
2×2 Matrix{Float64}:
 0.791215   1.0
 1.0       -0.779665

But after loading LinearMaps.jl v3.11.1 on julia v1.10-beta3, I get

julia> [randn(1,1) I; I randn(1,1)]
ERROR: MethodError: hvcat(::Tuple{Int64, Int64}, ::Matrix{Float64}, ::UniformScaling{Bool}, ::UniformScaling{Bool}, ::Matrix{Float64}) is ambiguous.

Candidates:
  hvcat(rows::Tuple{Vararg{Int64}}, As::Union{AbstractArray, LinearAlgebra.AbstractQ, UniformScaling, LinearMaps.LinearMap}...)
    @ LinearMaps ~/.julia/packages/LinearMaps/6ej60/src/blockmap.jl:165
  hvcat(rows::Tuple{Vararg{Int64}}, A::Union{Number, AbstractArray, UniformScaling}...)
    @ LinearAlgebra ~/.julia/juliaup/julia-1.10.0-beta3+0.x64.linux.gnu/share/julia/stdlib/v1.10/LinearAlgebra/src/uniformscaling.jl:447

Possible fix, define
  hvcat(::Tuple{Vararg{Int64}}, ::Vararg{Union{AbstractArray, UniformScaling}})

Stacktrace:
 [1] top-level scope
   @ REPL[12]:1

@dkarrasch
Copy link
Member

I think this is resolved, right?

               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.10.0 (2023-12-25)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using LinearAlgebra, LinearMaps
Precompiling LinearMaps
  1 dependency successfully precompiled in 3 seconds

julia> [randn(1,1) I; I randn(1,1)]
2×2 Matrix{Float64}:
 -1.11862  1.0
  1.0      0.63299

@mateuszbaran
Copy link
Author

Manifolds.jl works now but type piracy is something that should be avoided.

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

No branches or pull requests

3 participants