@@ -3856,7 +3856,10 @@ def process_typevar_parameters(
3856
3856
# We want to use our custom error message below, so we suppress
3857
3857
# the default error message for invalid types here.
3858
3858
analyzed = self .expr_to_analyzed_type (
3859
- param_value , allow_placeholder = True , report_invalid_types = False
3859
+ param_value ,
3860
+ allow_placeholder = True ,
3861
+ report_invalid_types = False ,
3862
+ allow_unbound_tvars = True ,
3860
3863
)
3861
3864
if analyzed is None :
3862
3865
# Type variables are special: we need to place them in the symbol table
@@ -6040,7 +6043,11 @@ def accept(self, node: Node) -> None:
6040
6043
report_internal_error (err , self .errors .file , node .line , self .errors , self .options )
6041
6044
6042
6045
def expr_to_analyzed_type (
6043
- self , expr : Expression , report_invalid_types : bool = True , allow_placeholder : bool = False
6046
+ self ,
6047
+ expr : Expression ,
6048
+ report_invalid_types : bool = True ,
6049
+ allow_placeholder : bool = False ,
6050
+ allow_unbound_tvars = False ,
6044
6051
) -> Type | None :
6045
6052
if isinstance (expr , CallExpr ):
6046
6053
# This is a legacy syntax intended mostly for Python 2, we keep it for
@@ -6065,7 +6072,10 @@ def expr_to_analyzed_type(
6065
6072
return TupleType (info .tuple_type .items , fallback = fallback )
6066
6073
typ = self .expr_to_unanalyzed_type (expr )
6067
6074
return self .anal_type (
6068
- typ , report_invalid_types = report_invalid_types , allow_placeholder = allow_placeholder
6075
+ typ ,
6076
+ report_invalid_types = report_invalid_types ,
6077
+ allow_placeholder = allow_placeholder ,
6078
+ allow_unbound_tvars = allow_unbound_tvars ,
6069
6079
)
6070
6080
6071
6081
def analyze_type_expr (self , expr : Expression ) -> None :
0 commit comments