Title: function call that returns `Never` incorrectly marked as unreachable when function that's defined later with multiple argument decorator is called · Issue #13043 · python/mypy · GitHub
Open Graph Title: function call that returns `Never` incorrectly marked as unreachable when function that's defined later with multiple argument decorator is called · Issue #13043 · python/mypy
X Title: function call that returns `Never` incorrectly marked as unreachable when function that's defined later with multiple argument decorator is called · Issue #13043 · python/mypy
Description: sorry for the wacky title from typing import TypeVar, Literal from typing_extensions import assert_never Fn = TypeVar("Fn") def foo(fn: Fn, value: bool = False) -> Fn: ... def bar(value: Literal[True]) -> None: if value: baz() else: asse...
Open Graph Description: sorry for the wacky title from typing import TypeVar, Literal from typing_extensions import assert_never Fn = TypeVar("Fn") def foo(fn: Fn, value: bool = False) -> Fn: ... def bar(value: Literal[Tr...
X Description: sorry for the wacky title from typing import TypeVar, Literal from typing_extensions import assert_never Fn = TypeVar("Fn") def foo(fn: Fn, value: bool = False) -> Fn: ... def bar(valu...
Opengraph URL: https://github.com/python/mypy/issues/13043
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"function call that returns `Never` incorrectly marked as unreachable when function that's defined later with multiple argument decorator is called","articleBody":"sorry for the wacky title\r\n```py\r\nfrom typing import TypeVar, Literal\r\nfrom typing_extensions import assert_never\r\n\r\nFn = TypeVar(\"Fn\")\r\n\r\n\r\ndef foo(fn: Fn, value: bool = False) -> Fn:\r\n ...\r\n\r\n\r\ndef bar(value: Literal[True]) -> None:\r\n if value:\r\n baz()\r\n else:\r\n assert_never(value) # error: Statement is unreachable [unreachable]\r\n\r\n\r\n@foo\r\ndef baz() -> None:\r\n ...\r\n```\r\n[playground](https://mypy-play.net/?mypy=latest&python=3.10&flags=show-error-codes%2Cwarn-unreachable&gist=5d9c29537790b7eeeb72c88547869f0a)\r\n\r\nfunctions that return `Never` are not supposed to be marked as unreachable - see https://github.com/python/mypy/issues/10916#issuecomment-1073526572","author":{"url":"https://github.com/DetachHead","@type":"Person","name":"DetachHead"},"datePublished":"2022-06-30T05:39:12Z","url":"https://github.com/python/mypy/issues/13043"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:669cc188-608b-2806-216b-37cf305e27b7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 87B0:2714DE:24E1E68:31F8F16:6B002CDE |
| html-safe-nonce | ba6ab17621c35cb343653ddf30a30ab2723ff2e1b82a601d76df78cdd44c48dd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4N0IwOjI3MTRERToyNEUxRTY4OjMxRjhGMTY6NkIwMDJDREUiLCJ2aXNpdG9yX2lkIjoiODQ4NTI0NjgxMDM1OTYwNjQ5NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a3b92630993a830d37a8a253d6e49060139e41fa2a370ee7b648e1f4e6344b54 |
| hovercard-subject-tag | issue:1289612390 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/mypy/13043/issue_layout |
| twitter:image | https://opengraph.githubassets.com/71eb661701b60e44162c0cead1d7eb9c2a68b76aace90bd3ef887e0886615eec/python/mypy/issues/13043 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/71eb661701b60e44162c0cead1d7eb9c2a68b76aace90bd3ef887e0886615eec/python/mypy/issues/13043 |
| og:image:alt | sorry for the wacky title from typing import TypeVar, Literal from typing_extensions import assert_never Fn = TypeVar("Fn") def foo(fn: Fn, value: bool = False) -> Fn: ... def bar(value: Literal[Tr... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | DetachHead |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/mypy git https://github.com/python/mypy.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 7053637 |
| octolytics-dimension-repository_nwo | python/mypy |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 7053637 |
| octolytics-dimension-repository_network_root_nwo | python/mypy |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f3f3a43ca095cdea3abbb394112e971f9fdb94fa |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width