Skip to content

Conversation

mohammadfawaz
Copy link
Collaborator

Original PR: #28905

When optional types were used with unsuffixed literals in binary/unary ops, the literals were incorrectly inferred as the full optional type.

So, this adds unwrapping and wrapping back (when returning) to properly handle optional types in binary and unary ops, to get unsuffixed literals to correctly infer as T instead of T?.

Resolves: #28902

When optional types were used with unsuffixed literals in binary/unary
ops, the literals were incorrectly inferred as the full optional type.

So, this adds unwrapping and wrapping back (when returning) to properly
handle optional types in binary and unary ops, to get unsuffixed
literals to correctly infer as T instead of T?.
@mohammadfawaz mohammadfawaz requested review from d0cd and vicsn October 10, 2025 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Optional types do not correctly propagate through binary operators

2 participants