[red-knot] Move type_alias_types test to Markdown (#15607)
## Summary Move `type_alias_types` test to Markdown ## Test Plan New MD test
This commit is contained in:
@@ -76,3 +76,20 @@ type ListOrSet[T] = list[T] | set[T]
|
||||
# as specified in the `typeshed` stubs.
|
||||
reveal_type(ListOrSet.__type_params__) # revealed: @Todo(@property)
|
||||
```
|
||||
|
||||
## `TypeAliasType` properties
|
||||
|
||||
Two `TypeAliasType`s are distinct and disjoint, even if they refer to the same type
|
||||
|
||||
```py
|
||||
from knot_extensions import static_assert, is_equivalent_to, is_disjoint_from, TypeOf
|
||||
|
||||
type Alias1 = int
|
||||
type Alias2 = int
|
||||
|
||||
type TypeAliasType1 = TypeOf[Alias1]
|
||||
type TypeAliasType2 = TypeOf[Alias2]
|
||||
|
||||
static_assert(not is_equivalent_to(TypeAliasType1, TypeAliasType2))
|
||||
static_assert(is_disjoint_from(TypeAliasType1, TypeAliasType2))
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user