Skip to content

Commit 0395ae9

Browse files
committed
more tests
1 parent f42cf93 commit 0395ae9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

crates/ty_python_semantic/resources/mdtest/type_properties/is_subtype_of_given.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,11 @@ def given_constraints[T]():
163163
static_assert(is_subtype_of_given(given_bool, T, bool))
164164
static_assert(not is_subtype_of_given(given_bool, T, str))
165165

166+
given_both = given_bool & given_int
167+
static_assert(is_subtype_of_given(given_both, T, int))
168+
static_assert(is_subtype_of_given(given_both, T, bool))
169+
static_assert(not is_subtype_of_given(given_both, T, str))
170+
166171
given_str = range_constraint(Never, T, str)
167172
static_assert(not is_subtype_of_given(given_str, T, int))
168173
static_assert(not is_subtype_of_given(given_str, T, bool))

0 commit comments

Comments
 (0)