Skip to content

Commit 3416461

Browse files
committed
Add reveal_type to test to verify commit stays str | None
1 parent a298d67 commit 3416461

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

test-data/unit/check-unreachable-code.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1655,5 +1655,5 @@ main:4: error: Statement is unreachable
16551655
# flags: --warn-unreachable
16561656
from typing import Any, Optional
16571657
def main(contents: Any, commit: Optional[str]) -> None:
1658-
if contents.get("commit") == commit and (commit is not None or 1):
1659-
pass
1658+
if contents.get("commit") == commit:
1659+
reveal_type(commit) # N: Revealed type is "builtins.str | None"

0 commit comments

Comments
 (0)