Skip to content

Type assert error in broadcasting on nightly #38422

@KristofferC

Description

@KristofferC

Running the tests for AutomotiveSimulator errors on nightly (https://s3.amazonaws.com/julialang-reports/nanosoldier/pkgeval/by_hash/c3bb6df_vs_788b2c7/AutomotiveSimulator.1.6.0-DEV-a896693d33.log) due to a type assert error in broadcasting.

feature extraction: Error During Test at /home/kc/PkgEval16/dev/AutomotiveSimulator/test/test_features.jl:119
  Got exception outside of a @test
  TypeError: in typeassert, expected AbstractVector{var"#s825"} where var"#s825"<:(AbstractVector{var"#s825"} where var"#s825"<:Union{Missing, Float64}), got a value of type Vector{Vector{T} where T}
  Stacktrace:
    [1] copy(bc::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1}, Tuple{Base.OneTo{Int64}}, AutomotiveSimulator.var"#25#26"{typeof(dist_to_front_neighbor), Roadway{Float64}, Vector{EntityScene{VehicleState, VehicleDef, Int64}}}, Tuple{Vector{Int64}}})
      @ Base.Broadcast ./broadcast.jl:928
    [2] materialize
      @ ./broadcast.jl:881 [inlined]
    [3] broadcast(f::AutomotiveSimulator.var"#25#26"{typeof(dist_to_front_neighbor), Roadway{Float64}, Vector{EntityScene{VehicleState, VehicleDef, Int64}}}, As::Vector{Int64})
      @ Base.Broadcast ./broadcast.jl:819
    [4] extract_feature(ft::SceneFeature, feature::Function, roadway::Roadway{Float64}, scenes::Vector{EntityScene{VehicleState, VehicleDef, Int64}}, ids::Vector{Int64})
      @ AutomotiveSimulator ~/PkgEval16/dev/AutomotiveSimulator/src/feature-extraction/features.jl:96
....

This type assert comes from:

julia/base/broadcast.jl

Lines 924 to 928 in 3dc54a2

# The typeassert gives inference a helping hand on the element type and dimensionality
# (work-around for #28382)
ElType′ = ElType <: Type ? Type : ElType
RT = dest isa AbstractArray ? AbstractArray{<:ElType′, ndims(dest)} : Any
return copyto_nonleaf!(dest, bc′, iter, state, 1)::RT

and was introduced in #30485.

Is the package doing something wrong or is this type assert a bit too strict?

cc @nalimilan

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions