Skip to content

VectorOfArrayStyle potentially relies on bug in Base.AbstractArrayStyle promotion rule #449

@adienes

Description

@adienes

revealed during a PkgEval run on JuliaLang/julia#35948, which contained errors like this

  MethodError: no method matching RecursiveArrayTools.VectorOfArrayStyle{2}(::Val{2})
  The type `RecursiveArrayTools.VectorOfArrayStyle{2}` exists, but no method is defined for this combination of argument types when trying to construct it.
  Closest candidates are:
    (::Type{RecursiveArrayTools.VectorOfArrayStyle{N}} where N)()
     @ RecursiveArrayTools ~/.julia/packages/RecursiveArrayTools/X30HP/src/vector_of_array.jl:462
  Stacktrace:
    [1] Base.Broadcast.BroadcastStyle(::Base.Broadcast.DefaultArrayStyle{0}, ::RecursiveArrayTools.VectorOfArrayStyle{2})
      @ Base.Broadcast ./broadcast.jl:141
    [2] result_style(s1::RecursiveArrayTools.VectorOfArrayStyle{2}, s2::Base.Broadcast.DefaultArrayStyle{0})
      @ Base.Broadcast ./broadcast.jl:465
    [3] combine_styles(c1::RecursiveArrayTools.VectorOfArray{ComplexF64, 2, Vector{Vector{ComplexF64}}}, c2::Float64)
      @ Base.Broadcast ./broadcast.jl:439
    [4] broadcasted
      @ ./broadcast.jl:1356 [inlined]
    [5] initial_step(f0::RecursiveArrayTools.VectorOfArray{ComplexF64, 2, Vector{Vector{ComplexF64}}}, u0::RecursiveArrayTools.VectorOfArray{ComplexF64, 2, Vector{Vector{ComplexF64}}}, atol::Float64, rtol::Float64)

potential errors in the definition of VectorOfArrayStyle here

struct VectorOfArrayStyle{N} <: Broadcast.AbstractArrayStyle{N} end # N is only used when voa sees other abstract arrays
could have been exposed by the bugfix

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions