We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f42cf93 commit 0395ae9Copy full SHA for 0395ae9
crates/ty_python_semantic/resources/mdtest/type_properties/is_subtype_of_given.md
@@ -163,6 +163,11 @@ def given_constraints[T]():
163
static_assert(is_subtype_of_given(given_bool, T, bool))
164
static_assert(not is_subtype_of_given(given_bool, T, str))
165
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
+
171
given_str = range_constraint(Never, T, str)
172
static_assert(not is_subtype_of_given(given_str, T, int))
173
static_assert(not is_subtype_of_given(given_str, T, bool))
0 commit comments