-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Type assert error in broadcasting on nightly #38422
Comments
Ouch. The code where this happens is a series of nested julia> x = Vector{<:Union{Int, Missing}}[[1, 2],[missing, 1]]
2-element Vector{Vector{var"#s1"} where var"#s1"<:Union{Missing, Int64}}:
[1, 2]
Union{Missing, Int64}[missing, 1]
julia> identity.(x)
ERROR: TypeError: in typeassert, expected AbstractVector{var"#s823"} where var"#s823"<:(Vector{var"#s1"} where var"#s1"<:Union{Missing, Int64}), got a value of type Vector{Vector{T} where T}
Stacktrace:
[1] copy
@ ./broadcast.jl:928 [inlined]
[2] materialize(bc::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1}, Nothing, typeof(identity), Tuple{Vector{Vector{var"#s1"} where var"#s1"<:Union{Missing, Int64}}}})
@ Base.Broadcast ./broadcast.jl:881
[3] top-level scope
@ REPL[12]:1 This is due to this discrepancy: julia> Base.Broadcast.promote_typejoin_union(Vector{<:Union{Int, Missing}})
Vector{var"#s1"} where var"#s1"<:Union{Missing, Int64} (alias for Array{var"#s1", 1} where var"#s1"<:Union{Missing, Int64})
julia> Base.promote_typejoin(Vector{Int}, Vector{Missing})
Vector{T} where T (alias for Array{T, 1} where T) #38428 has a simple fix until we find a better solution. |
So I'm experiencing something very similar on using Pkg; Pkg.add("Cyclotomics")
using Cyclotomics
E(3).*[1,2,3] produces ERROR: TypeError: in typeassert, expected AbstractVector{var"#s827"} where var"#s827"<:Type, got a value of type Vector{Cyclotomic{Int64, SparseArrays.SparseVector{Int64, Int64}}}
Stacktrace:
[1] copy
@ ./broadcast.jl:930 [inlined]
[2] materialize(bc::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1}, Nothing, typeof(*), Tuple{Cyclotomic{Int64, SparseArrays.SparseVector{Int64, Int64}}, Vector{Int64}}})
@ Base.Broadcast ./broadcast.jl:883
[3] top-level scope
@ REPL[3]:1 A Note that wrapping with julia> Ref(E(3)) .* [1,2,3]
3-element Vector{Cyclotomic{Int64, SparseArrays.SparseVector{Int64, Int64}}}:
ζ₃
2*ζ₃
3*ζ₃ This code worked just fine on julia-1.5 and before |
Argh, this change seems to trigger bugs in lots of corner cases... In this case, it seems to be because |
Thanks, that's lightning fast! I know this |
OK, good.
Yes, that sounds like a good idea. The current docstring for |
following discussion in JuliaLang#38422
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.
This type assert comes from:
julia/base/broadcast.jl
Lines 924 to 928 in 3dc54a2
and was introduced in #30485.
Is the package doing something wrong or is this type assert a bit too strict?
cc @nalimilan
The text was updated successfully, but these errors were encountered: