-
Notifications
You must be signed in to change notification settings - Fork 227
Open
Labels
genericsBugs or features relating to ty's generics implementationBugs or features relating to ty's generics implementation
Milestone
Description
Summary
Checking the following code
from typing import TypeVar
D = TypeVar('D')
def foo(x: D = None) -> D:
return xGives
error[invalid-parameter-default]: Default value of type `None` is not assignable to annotated parameter type `D`
--> ex.py:6:9
|
6 | def foo(x: D = None) -> D:
| ^^^^^^^^^^^
7 | return x
|
info: rule `invalid-parameter-default` is enabled by default
This passes with pyright and IMHO should not cause an error.
Apologies if this is reported elsewhere, nothing came up with the search "invalid-parameter-default generic".
Version
ty 0.0.1-alpha.8 (c1337c9 2025-06-02)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
genericsBugs or features relating to ty's generics implementationBugs or features relating to ty's generics implementation