Last active
July 9, 2019 13:14
-
-
Save hackaugusto/620eb4421587edf16541f1b0c78e32df to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from typing import List, NoReturn | |
| class Uninhabited: | |
| pass | |
| def never(x: Uninhabited) -> NoReturn: | |
| raise RuntimeError() | |
| def f2() -> int: | |
| v: List[int] = [1] | |
| if isinstance(v, list): | |
| pass | |
| else: | |
| never(v) | |
| return 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| exhaustive.py:18: error: Argument 1 to "never" has incompatible type "List[int]"; expected "Uninhabited" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment