Skip to content

Conversation

@sharkdp
Copy link
Contributor

@sharkdp sharkdp commented Oct 31, 2025

Summary

closes astral-sh/ty#1284

supersedes #20950 by @ibraheemdev

Test Plan

New regression test

@sharkdp sharkdp added bug Something isn't working ty Multi-file analysis & type inference labels Oct 31, 2025
@github-actions
Copy link
Contributor

Diagnostic diff on typing conformance tests

No changes detected when running ty on typing conformance tests ✅

@github-actions
Copy link
Contributor

mypy_primer results

Changes were detected when running on open source projects
dd-trace-py (https://github.com/DataDog/dd-trace-py)
- ddtrace/contrib/internal/django/user.py:50:53: error[invalid-argument-type] Argument expression after ** must be a mapping with `str` key type: Found `Unknown | (EnvVariable[str] & ~AlwaysFalsy) | str`
+ ddtrace/contrib/internal/django/user.py:50:53: error[invalid-argument-type] Argument expression after ** must be a mapping with `str` key type: Found `Unknown | (EnvVariable[Literal[""]] & ~AlwaysFalsy) | str`
No memory usage changes detected ✅

@sharkdp sharkdp marked this pull request as ready for review October 31, 2025 16:34
@sharkdp sharkdp changed the title [ty] Do not promote literals in contravariant positions [ty] Do not promote literals in contravariant positions of generic specializations Oct 31, 2025
@sharkdp sharkdp merged commit 1734ddf into main Oct 31, 2025
43 checks passed
@sharkdp sharkdp deleted the david/fix-1284 branch October 31, 2025 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Should literal promotion recurse into generic types?

3 participants