-
-
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
map
ping a NamedTuple
prints Internal error: encountered unexpected error in runtime
#49785
Comments
Reduction: struct DiscriminatedUnion{S, T<:S} end
function subtypes()
map(T -> DiscriminatedUnion{Union{Type{String},Type{Int}}[Int][1],T}, (a = Int,))
end
subtypes() Confirmed to also repro on 1.9.0. |
I think Lines 1668 to 1670 in 6733197
needs to check whether EDIT: OTOH, this seems fixed on master, so there might be a better fix to backport. |
map
ping a NamedTuple
prints Internal error: encountered unexpected error in runtime
map
ping a NamedTuple
prints Internal error: encountered unexpected error in runtime
Hm, looks like this was fixed by 95cfd62 and then broken again by 5a684f0 -- which reverted the former, but only for 1.9. Anyway, that fix was more of a fluke anyway, since this variation also fails on master: function subtypes()
map(T -> DiscriminatedUnion{Union{Type{String},Type{Int}}[Int][1],T}, (a = Union{Type{String},Type{Int}}[Int][1],))
end |
map
ping a NamedTuple
prints Internal error: encountered unexpected error in runtime
map
ping a NamedTuple
prints Internal error: encountered unexpected error in runtime
For types like `Foo{S, T<:S}`, `apply_type_nothrow` could in some situations check whether the argument is a subtype of the upper bound of `T`, i.e. `S`, but subtyping agaist a plain `TypeVar` would fail. Instead return `false` in this case. Fixes #49785.
I tested this on Julia 1.8.5 and 1.9beta3 (on an M1 mac but we've seen this on other architectures as well)
Calling
subtypes
prints out this super long trace, at the end of which you can see the correct output(audi = DiscriminatedUnion{Car, Audi}, mercedes = DiscriminatedUnion{Car, Mercedes})
.I can avoid the error by replacing
map(T -> DiscriminatedUnion{SUP,T}, concrete_type_mapping(SUP))
withThe text was updated successfully, but these errors were encountered: