Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/subtype.c
Original file line number Diff line number Diff line change
Expand Up @@ -2760,7 +2760,7 @@ static jl_value_t *intersect_sub_datatype(jl_datatype_t *xd, jl_datatype_t *yd,
jl_value_t *isuper = R ? intersect((jl_value_t*)yd, (jl_value_t*)xd->super, e, param) :
intersect((jl_value_t*)xd->super, (jl_value_t*)yd, e, param);
if (isuper == jl_bottom_type) return jl_bottom_type;
if (jl_nparams(xd) == 0 || jl_nparams(xd->super) == 0)
if (jl_nparams(xd) == 0 || jl_nparams(xd->super) == 0 || !jl_has_free_typevars(xd))
return (jl_value_t*)xd;
jl_value_t *super_pattern=NULL;
JL_GC_PUSH2(&isuper, &super_pattern);
Expand Down
7 changes: 7 additions & 0 deletions test/subtype.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1759,3 +1759,10 @@ s26065 = Ref{Tuple{T,Ref{Union{Ref{Tuple{Ref{Union{Ref{Ref{Tuple{Ref{Tuple{Union
# issue 36100
@test NamedTuple{(:a, :b), Tuple{Missing, Union{}}} == NamedTuple{(:a, :b), Tuple{Missing, Union{}}}
@test Val{Tuple{Missing, Union{}}} === Val{Tuple{Missing, Union{}}}

# issue #36869
struct F36869{T, V} <: AbstractArray{Union{T, V}, 1}
end
@testintersect(Tuple{Type{T}, AbstractVector{T}} where T,
Tuple{Union, F36869{Int64, Missing}},
Tuple{Union, F36869{Int64, Missing}})