@@ -4189,7 +4189,7 @@ def check_lst_expr(self, e: ListExpr | SetExpr | TupleExpr, fullname: str, tag:
41894189 # Used for list and set expressions, as well as for tuples
41904190 # containing star expressions that don't refer to a
41914191 # Tuple. (Note: "lst" stands for list-set-tuple. :-)
4192- tv = TypeVarType ("T" , "T" , - 1 , [], self .object_type ())
4192+ tv = TypeVarType ("T" , "T" , id = - 1 , values = [], upper_bound = self .object_type ())
41934193 constructor = CallableType (
41944194 [tv ],
41954195 [nodes .ARG_STAR ],
@@ -4357,8 +4357,8 @@ def visit_dict_expr(self, e: DictExpr) -> Type:
43574357 return dt
43584358
43594359 # Define type variables (used in constructors below).
4360- kt = TypeVarType ("KT" , "KT" , - 1 , [], self .object_type ())
4361- vt = TypeVarType ("VT" , "VT" , - 2 , [], self .object_type ())
4360+ kt = TypeVarType ("KT" , "KT" , id = - 1 , values = [], upper_bound = self .object_type ())
4361+ vt = TypeVarType ("VT" , "VT" , id = - 2 , values = [], upper_bound = self .object_type ())
43624362
43634363 # Collect function arguments, watching out for **expr.
43644364 args : list [Expression ] = []
@@ -4722,7 +4722,7 @@ def check_generator_or_comprehension(
47224722
47234723 # Infer the type of the list comprehension by using a synthetic generic
47244724 # callable type.
4725- tv = TypeVarType ("T" , "T" , - 1 , [], self .object_type ())
4725+ tv = TypeVarType ("T" , "T" , id = - 1 , values = [], upper_bound = self .object_type ())
47264726 tv_list : list [Type ] = [tv ]
47274727 constructor = CallableType (
47284728 tv_list ,
@@ -4742,8 +4742,8 @@ def visit_dictionary_comprehension(self, e: DictionaryComprehension) -> Type:
47424742
47434743 # Infer the type of the list comprehension by using a synthetic generic
47444744 # callable type.
4745- ktdef = TypeVarType ("KT" , "KT" , - 1 , [], self .object_type ())
4746- vtdef = TypeVarType ("VT" , "VT" , - 2 , [], self .object_type ())
4745+ ktdef = TypeVarType ("KT" , "KT" , id = - 1 , values = [], upper_bound = self .object_type ())
4746+ vtdef = TypeVarType ("VT" , "VT" , id = - 2 , values = [], upper_bound = self .object_type ())
47474747 constructor = CallableType (
47484748 [ktdef , vtdef ],
47494749 [nodes .ARG_POS , nodes .ARG_POS ],
0 commit comments