File tree Expand file tree Collapse file tree 1 file changed +14
-12
lines changed Expand file tree Collapse file tree 1 file changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -2100,7 +2100,7 @@ def infer_function_type_arguments(
21002100
21012101 if True : # NEW CODE
21022102 # compute the inner constraints
2103- inner_constraints = infer_constraints_for_callable (
2103+ _inner_constraints = infer_constraints_for_callable (
21042104 callee_type ,
21052105 pass1_args ,
21062106 arg_kinds ,
@@ -2109,18 +2109,20 @@ def infer_function_type_arguments(
21092109 context = self .argument_infer_context (),
21102110 )
21112111 # HACK: convert "Literal?" constraints to their non-literal versions.
2112- inner_constraints = [
2113- Constraint (
2114- c .original_type_var ,
2115- c .op ,
2116- (
2117- c .target .copy_modified (last_known_value = None )
2118- if isinstance (c .target , Instance )
2119- else c .target
2120- ),
2112+ inner_constraints : list [Constraint ] = []
2113+ for constraint in _inner_constraints :
2114+ target = get_proper_type (constraint .target )
2115+ inner_constraints .append (
2116+ Constraint (
2117+ constraint .original_type_var ,
2118+ constraint .op ,
2119+ (
2120+ target .copy_modified (last_known_value = None )
2121+ if isinstance (target , Instance )
2122+ else target
2123+ ),
2124+ )
21212125 )
2122- for c in inner_constraints
2123- ]
21242126
21252127 # compute the outer solution
21262128 outer_constraints = self .infer_constraints_from_context (callee_type , context )
You can’t perform that action at this time.
0 commit comments