File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -277,8 +277,13 @@ def infer_constraints_for_callable(
277277 if any (isinstance (v , ParamSpecType ) for v in callee .variables ):
278278 # As a perf optimization filter imprecise constraints only when we can have them.
279279 constraints = filter_imprecise_kinds (constraints )
280- for pconstraint in priority_constraints :
281- constraints = [c for c in constraints if c .type_var != pconstraint .type_var ]
280+
281+ # TODO: consider passing this up the call stack
282+ for tv in {c .origin_type_var for c in priority_constraints }:
283+ from mypy .solve import solve_constraints
284+
285+ if solve_constraints ([tv ], constraints + priority_constraints )[0 ][0 ] is None :
286+ constraints = [c for c in constraints if c .type_var != tv .id ]
282287
283288 return constraints + priority_constraints
284289
You can’t perform that action at this time.
0 commit comments