Skip to content

Commit e8d2d95

Browse files
committed
tolerate non-types as Tuple parameters better
part of #19998
1 parent 474d05d commit e8d2d95

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/subtype.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ static int is_leaf_bound(jl_value_t *v)
414414
}
415415
return 1;
416416
}
417-
return 0;
417+
return !jl_is_type(v) && !jl_is_typevar(v);
418418
}
419419

420420
static jl_value_t *widen_Type(jl_value_t *t)

test/subtype.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,3 +938,6 @@ ftwoparams(::TwoParams{<:Real,<:Real}) = 3
938938
# supertype operator
939939
@test !(Int >: Integer)
940940
@test Integer >: Int
941+
942+
# tolerate non-types in Tuples
943+
@test typeintersect(Tuple{0}, Tuple{T} where T) === Tuple{0}

0 commit comments

Comments
 (0)