Commit 273a065
Preserve container type in
`[zero(u) for u in VA.u]` always produces a plain `Vector`, even when
`VA.u` is a `StructVector` (from StructArrays.jl). The constructor
then fails with `MethodError: Cannot convert Vector{SVector{1,Float64}}
to StructVector{...}` because the type parameter `A` is locked to the
original container type.
Use the existing `rewrap(parent, u)` mechanism (already used by
broadcast) to convert the comprehension result back to the original
container type. The `StructArrays` extension defines
`rewrap(::StructArray, u) = StructArray(u)`, and the fallback is
`convert(typeof(parent), u)`.
Fixes OrdinaryDiffEq.jl v7 CI failures in OrdinaryDiffEqLowStorageRK
and OrdinaryDiffEqSSPRK "VectorOfArray/StructArray compatibility" tests.
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>zero(VectorOfArray) via rewrap
1 parent 25b5e64 commit 273a065
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
945 | 945 | | |
946 | 946 | | |
947 | 947 | | |
948 | | - | |
| 948 | + | |
949 | 949 | | |
950 | 950 | | |
951 | 951 | | |
| |||
0 commit comments