@@ -1147,10 +1147,10 @@ static_assert(
11471147 )
11481148)
11491149
1150- static_assert(not is_equivalent_to(GenericProto[str ], GenericProto[int ]))
1151- static_assert(not is_equivalent_to(GenericProto[str ], LegacyGenericProto[int ]))
1152- static_assert(not is_equivalent_to(GenericProto, GenericProto[int ]))
1153- static_assert(not is_equivalent_to(LegacyGenericProto, LegacyGenericProto[int ]))
1150+ static_assert(not is_equivalent_to(GenericProto[str ], GenericProto[int ])) # error: [static-assert-error]
1151+ static_assert(not is_equivalent_to(GenericProto[str ], LegacyGenericProto[int ])) # error: [static-assert-error]
1152+ static_assert(not is_equivalent_to(GenericProto, GenericProto[int ])) # error: [static-assert-error]
1153+ static_assert(not is_equivalent_to(LegacyGenericProto, LegacyGenericProto[int ])) # error: [static-assert-error]
11541154```
11551155
11561156## Intersections of protocols
@@ -1543,8 +1543,7 @@ from ty_extensions import is_equivalent_to
15431543class HasMutableXAttr (Protocol ):
15441544 x: int
15451545
1546- # TODO : should pass
1547- static_assert(is_equivalent_to(HasMutableXAttr, HasMutableXProperty)) # error: [static-assert-error]
1546+ static_assert(is_equivalent_to(HasMutableXAttr, HasMutableXProperty))
15481547
15491548static_assert(is_subtype_of(HasMutableXAttr, HasXProperty))
15501549static_assert(is_assignable_to(HasMutableXAttr, HasXProperty))
@@ -1835,9 +1834,7 @@ class P4(Protocol):
18351834 def z (self , value : int ) -> None : ...
18361835
18371836static_assert(is_equivalent_to(P1, P2))
1838-
1839- # TODO : should pass
1840- static_assert(is_equivalent_to(P3, P4)) # error: [static-assert-error]
1837+ static_assert(is_equivalent_to(P3, P4))
18411838```
18421839
18431840As with protocols that only have non-method members, this also holds true when they appear in
@@ -1848,9 +1845,7 @@ class A: ...
18481845class B : ...
18491846
18501847static_assert(is_equivalent_to(A | B | P1, P2 | B | A))
1851-
1852- # TODO : should pass
1853- static_assert(is_equivalent_to(A | B | P3, P4 | B | A)) # error: [static-assert-error]
1848+ static_assert(is_equivalent_to(A | B | P3, P4 | B | A))
18541849```
18551850
18561851## Narrowing of protocols
@@ -2131,8 +2126,6 @@ class Bar(Protocol):
21312126 @ property
21322127 def x (self ) -> " Bar" : ...
21332128
2134- # TODO : this should pass
2135- # error: [static-assert-error]
21362129static_assert(is_equivalent_to(Foo, Bar))
21372130
21382131T = TypeVar(" T" , bound = " TypeVarRecursive" )
0 commit comments