Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork3.1k
Closed
Description
This is related to#12998.
https://mypy-play.net/?mypy=latest&python=3.12&gist=42bbd2ec432dbfd003429c64b8dc7435
fromtypingimportassert_neverasyncdeffn()->int|None:returnNoneasyncdeffoo()->None:matchawaitfn():caseint():passcaseNone:passcasenever:assert_never(never)# error: Argument 1 to "assert_never" has incompatible type "int | None"; expected "NoReturn" [arg-type]asyncdefbar()->None:a=fn()matchawaita:caseint():passcaseNone:passcasenever:assert_never(never)# error: Argument 1 to "assert_never" has incompatible type "int | None"; expected "NoReturn" [arg-type]asyncdefbaz()->None:match_a:=awaitfn():caseint():passcaseNone:passcasenever:assert_never(never)# works!
I also sent#17199 with a test case that demonstrates the bug.