-
Notifications
You must be signed in to change notification settings - Fork 333
Avoid literal promotion when constructing frozenset from list/set literal #2280
Copy link
Copy link
Open
Labels
bidirectional inferenceInference of types that takes into account the context of a declared type or expected typeInference of types that takes into account the context of a declared type or expected typegenericsBugs or features relating to ty's generics implementationBugs or features relating to ty's generics implementationliteral-typesLiteral and LiteralString type inference, promotion, narrowing, assignability, and displayLiteral and LiteralString type inference, promotion, narrowing, assignability, and display
Description
Activity
Metadata
Metadata
Assignees
Labels
bidirectional inferenceInference of types that takes into account the context of a declared type or expected typeInference of types that takes into account the context of a declared type or expected typegenericsBugs or features relating to ty's generics implementationBugs or features relating to ty's generics implementationliteral-typesLiteral and LiteralString type inference, promotion, narrowing, assignability, and displayLiteral and LiteralString type inference, promotion, narrowing, assignability, and display
Summary
Literal promotion is currently performed for
tuplebut not forfrozenset. This is surprising to me given that they both are immutable and behave somewhat similarly. It could be useful to changefrozenset, for instance to support the following comparisons:https://play.ty.dev/464c2ef8-e7bc-4e74-938f-3c0f2cd20916
Related: #1284 (comment)
Version
ty 0.0.8 (aa7559d 2025-12-29)