ruff
85d0b3fb - [ty] Preserve generic inference errors during diagnostic recovery (#28811)

Commit
19 days ago
[ty] Preserve generic inference errors during diagnostic recovery (#28811) A failed generic call recovers by building a union of all inferred constraints. If the recovered union does not satisfy the bounds of a constrained type variable, we should still report diagnostics for the unsatisfied constraints: ```py def f[T: (int, str)](x: T, y: T) -> T: return x def _(x: int, y: str) -> None: # error: [invalid-argument-type] reveal_type(f(x, y)) # revealed: int | str ```
Author
Parents
Loading