[ty] Avoid narrowing on non-generic calls#22102
Conversation
Diagnostic diff on typing conformance testsNo changes detected when running ty on typing conformance tests ✅ |
|
CodSpeed Performance ReportMerging #22102 will improve performance by ×9.7Comparing Summary
Benchmarks breakdown
Footnotes
|
| // We only need to attempt narrowing on generic calls, otherwise the type | ||
| // context has no effect. |
There was a problem hiding this comment.
Hmm is this true? Doesn't e.g. a type context of a TypedDict affect inference of a dict literal, even for non-generic calls?
There was a problem hiding this comment.
Oh but I guess in those cases we don't support a union type context
There was a problem hiding this comment.
A dictionary literal argument? If the call is non-generic, the only relevant type-context there is the annotated parameter type, which does not contain any type variables.
Summary
Resolves astral-sh/ty#2026.