-
Notifications
You must be signed in to change notification settings - Fork 216
Open
9 / 209 of 20 issues completedLabels
genericsBugs or features relating to ty's generics implementationBugs or features relating to ty's generics implementation
Milestone
Description
Summary
def safe[T](value: T | None) -> T: ...
def _(value: int | None):
reveal_type(safe(value)) # int | Noneit looks like T is being inferred as int | None, but it would be more convenient if it was inferred as int, so that the safe function can behave sort of like a type guard that removes None from types.
both pyright and mypy support inferring the generics this way.
Version
0.0.1-alpha.8 (c1337c9 2025-06-02)
Reactions are currently unavailable
Sub-issues
Metadata
Metadata
Assignees
Labels
genericsBugs or features relating to ty's generics implementationBugs or features relating to ty's generics implementation