Skip to content

Commit 0ddd940

Browse files
committed
Add a test for accidental discord.py fix
1 parent 59ea2a0 commit 0ddd940

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

test-data/unit/check-functions.test

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3768,3 +3768,11 @@ class C:
37683768

37693769
def defer() -> int:
37703770
return 1
3771+
3772+
[case testNarrowingForDefaultInInnerFunction]
3773+
from typing import Optional
3774+
3775+
def outer(x: Optional[float]) -> None:
3776+
if x is not None:
3777+
def inner(y: float = x) -> None: ... # OK
3778+
def bad(y: float = x) -> None: ... # E: Incompatible default for parameter "y" (default has type "float | None", parameter has type "float")

0 commit comments

Comments
 (0)