@@ -5106,9 +5106,9 @@ def has_any_type(t: Type, ignore_in_type_obj: bool = False) -> bool:
51065106 return t .accept (HasAnyType (ignore_in_type_obj ))
51075107
51085108
5109- class HasAnyType (types .TypeQuery [ bool ] ):
5109+ class HasAnyType (types .BoolTypeQuery ):
51105110 def __init__ (self , ignore_in_type_obj : bool ) -> None :
5111- super ().__init__ (any )
5111+ super ().__init__ (types . ANY_STRATEGY )
51125112 self .ignore_in_type_obj = ignore_in_type_obj
51135113
51145114 def visit_any (self , t : AnyType ) -> bool :
@@ -5185,7 +5185,7 @@ def replace_callable_return_type(c: CallableType, new_ret_type: Type) -> Callabl
51855185 return c .copy_modified (ret_type = new_ret_type )
51865186
51875187
5188- class ArgInferSecondPassQuery (types .TypeQuery [ bool ] ):
5188+ class ArgInferSecondPassQuery (types .BoolTypeQuery ):
51895189 """Query whether an argument type should be inferred in the second pass.
51905190
51915191 The result is True if the type has a type variable in a callable return
@@ -5194,17 +5194,17 @@ class ArgInferSecondPassQuery(types.TypeQuery[bool]):
51945194 """
51955195
51965196 def __init__ (self ) -> None :
5197- super ().__init__ (any )
5197+ super ().__init__ (types . ANY_STRATEGY )
51985198
51995199 def visit_callable_type (self , t : CallableType ) -> bool :
52005200 return self .query_types (t .arg_types ) or t .accept (HasTypeVarQuery ())
52015201
52025202
5203- class HasTypeVarQuery (types .TypeQuery [ bool ] ):
5203+ class HasTypeVarQuery (types .BoolTypeQuery ):
52045204 """Visitor for querying whether a type has a type variable component."""
52055205
52065206 def __init__ (self ) -> None :
5207- super ().__init__ (any )
5207+ super ().__init__ (types . ANY_STRATEGY )
52085208
52095209 def visit_type_var (self , t : TypeVarType ) -> bool :
52105210 return True
@@ -5214,11 +5214,11 @@ def has_erased_component(t: Type | None) -> bool:
52145214 return t is not None and t .accept (HasErasedComponentsQuery ())
52155215
52165216
5217- class HasErasedComponentsQuery (types .TypeQuery [ bool ] ):
5217+ class HasErasedComponentsQuery (types .BoolTypeQuery ):
52185218 """Visitor for querying whether a type has an erased component."""
52195219
52205220 def __init__ (self ) -> None :
5221- super ().__init__ (any )
5221+ super ().__init__ (types . ANY_STRATEGY )
52225222
52235223 def visit_erased_type (self , t : ErasedType ) -> bool :
52245224 return True
@@ -5228,11 +5228,11 @@ def has_uninhabited_component(t: Type | None) -> bool:
52285228 return t is not None and t .accept (HasUninhabitedComponentsQuery ())
52295229
52305230
5231- class HasUninhabitedComponentsQuery (types .TypeQuery [ bool ] ):
5231+ class HasUninhabitedComponentsQuery (types .BoolTypeQuery ):
52325232 """Visitor for querying whether a type has an UninhabitedType component."""
52335233
52345234 def __init__ (self ) -> None :
5235- super ().__init__ (any )
5235+ super ().__init__ (types . ANY_STRATEGY )
52365236
52375237 def visit_uninhabited_type (self , t : UninhabitedType ) -> bool :
52385238 return True
0 commit comments