Title: Crash on complicated ParamSpec usage · Issue #15824 · python/mypy · GitHub
Open Graph Title: Crash on complicated ParamSpec usage · Issue #15824 · python/mypy
X Title: Crash on complicated ParamSpec usage · Issue #15824 · python/mypy
Description: Crash Report mypy crashes. Traceback (project_3.11) C:\Code>mypy mypy_1.5_crash.py --show-traceback mypy_1.5_crash.py:6: error: Missing return statement [empty-body] mypy_1.5_crash.py:12: error: Missing return statement [empty-body] mypy...
Open Graph Description: Crash Report mypy crashes. Traceback (project_3.11) C:\Code>mypy mypy_1.5_crash.py --show-traceback mypy_1.5_crash.py:6: error: Missing return statement [empty-body] mypy_1.5_crash.py:12: error: Mi...
X Description: Crash Report mypy crashes. Traceback (project_3.11) C:\Code>mypy mypy_1.5_crash.py --show-traceback mypy_1.5_crash.py:6: error: Missing return statement [empty-body] mypy_1.5_crash.py:12: error:...
Opengraph URL: https://github.com/python/mypy/issues/15824
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Crash on complicated ParamSpec usage","articleBody":"**Crash Report**\r\n\r\nmypy crashes.\r\n\r\n**Traceback**\r\n\r\n```\r\n(project_3.11) C:\\Code>mypy mypy_1.5_crash.py --show-traceback\r\nmypy_1.5_crash.py:6: error: Missing return statement [empty-body]\r\nmypy_1.5_crash.py:12: error: Missing return statement [empty-body]\r\nmypy_1.5_crash.py:11: error: INTERNAL ERROR -- Please try using mypy master on GitHub: \r\nhttps://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build\r\nPlease report a bug at https://github.com/python/mypy/issues\r\nversion: 1.6.0+dev.5617cdd03d12ff73622c8d4b496979e0377b1675\r\nTraceback (most recent call last):\r\n File \"\u003cfrozen runpy>\", line 198, in _run_module_as_main\r\n File \"\u003cfrozen runpy>\", line 88, in _run_code\r\n File \"C:\\Users\\bers\\.pyenv-win-venv\\envs\\project_3.11\\Scripts\\mypy.exe\\__main__.py\", line 7, in \u003cmodule>\r\n sys.exit(console_entry())\r\n File \"C:\\Users\\bers\\.pyenv-win-venv\\envs\\project_3.11\\Lib\\site-packages\\mypy\\__main__.py\", line 15, in console_entry \r\n main()\r\n File \"C:\\Users\\bers\\.pyenv-win-venv\\envs\\project_3.11\\Lib\\site-packages\\mypy\\main.py\", line 94, in main\r\n res, messages, blockers = run_build(sources, options, fscache, t0, stdout, stderr)\r\n File \"C:\\Users\\bers\\.pyenv-win-venv\\envs\\project_3.11\\Lib\\site-packages\\mypy\\main.py\", line 173, in run_build\r\n res = build.build(sources, options, None, flush_errors, fscache, stdout, stderr)\r\n File \"C:\\Users\\bers\\.pyenv-win-venv\\envs\\project_3.11\\Lib\\site-packages\\mypy\\build.py\", line 195, in build\r\n result = _build(\r\n File \"C:\\Users\\bers\\.pyenv-win-venv\\envs\\project_3.11\\Lib\\site-packages\\mypy\\build.py\", line 268, in _build\r\n graph = dispatch(sources, manager, stdout)\r\n File \"C:\\Users\\bers\\.pyenv-win-venv\\envs\\project_3.11\\Lib\\site-packages\\mypy\\build.py\", line 2927, in dispatch\r\n process_graph(graph, manager)\r\n File \"C:\\Users\\bers\\.pyenv-win-venv\\envs\\project_3.11\\Lib\\site-packages\\mypy\\build.py\", line 3325, in process_graph \r\n process_stale_scc(graph, scc, manager)\r\n File \"C:\\Users\\bers\\.pyenv-win-venv\\envs\\project_3.11\\Lib\\site-packages\\mypy\\build.py\", line 3426, in process_stale_scc \r\n graph[id].type_check_first_pass()\r\n File \"C:\\Users\\bers\\.pyenv-win-venv\\envs\\project_3.11\\Lib\\site-packages\\mypy\\build.py\", line 2312, in type_check_first_pass\r\n self.type_checker().check_first_pass()\r\n File \"C:\\Users\\bers\\.pyenv-win-venv\\envs\\project_3.11\\Lib\\site-packages\\mypy\\checker.py\", line 475, in check_first_pass \r\n self.accept(d)\r\n File \"C:\\Users\\bers\\.pyenv-win-venv\\envs\\project_3.11\\Lib\\site-packages\\mypy\\checker.py\", line 585, in accept\r\n stmt.accept(self)\r\n File \"C:\\Users\\bers\\.pyenv-win-venv\\envs\\project_3.11\\Lib\\site-packages\\mypy\\nodes.py\", line 898, in accept\r\n return visitor.visit_decorator(self)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\Users\\bers\\.pyenv-win-venv\\envs\\project_3.11\\Lib\\site-packages\\mypy\\checker.py\", line 4776, in visit_decorator \r\n sig, t2 = self.expr_checker.check_call(\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\Users\\bers\\.pyenv-win-venv\\envs\\project_3.11\\Lib\\site-packages\\mypy\\checkexpr.py\", line 1437, in check_call\r\n return self.check_callable_call(\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\Users\\bers\\.pyenv-win-venv\\envs\\project_3.11\\Lib\\site-packages\\mypy\\checkexpr.py\", line 1628, in check_callable_call\r\n self.check_argument_types(\r\n File \"C:\\Users\\bers\\.pyenv-win-venv\\envs\\project_3.11\\Lib\\site-packages\\mypy\\checkexpr.py\", line 2324, in check_argument_types\r\n check_arg(\r\n File \"C:\\Users\\bers\\.pyenv-win-venv\\envs\\project_3.11\\Lib\\site-packages\\mypy\\checkexpr.py\", line 2360, in check_arg\r\n elif not is_subtype(caller_type, callee_type, options=self.chk.options):\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\Users\\bers\\.pyenv-win-venv\\envs\\project_3.11\\Lib\\site-packages\\mypy\\subtypes.py\", line 177, in is_subtype\r\n return _is_subtype(left, right, subtype_context, proper_subtype=False)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\Users\\bers\\.pyenv-win-venv\\envs\\project_3.11\\Lib\\site-packages\\mypy\\subtypes.py\", line 332, in _is_subtype\r\n return left.accept(SubtypeVisitor(orig_right, subtype_context, proper_subtype))\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\Users\\bers\\.pyenv-win-venv\\envs\\project_3.11\\Lib\\site-packages\\mypy\\types.py\", line 1923, in accept\r\n return visitor.visit_callable_type(self)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\Users\\bers\\.pyenv-win-venv\\envs\\project_3.11\\Lib\\site-packages\\mypy\\subtypes.py\", line 692, in visit_callable_type\r\n return is_callable_compatible(\r\n ^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\Users\\bers\\.pyenv-win-venv\\envs\\project_3.11\\Lib\\site-packages\\mypy\\subtypes.py\", line 1418, in is_callable_compatible\r\n unified = unify_generic_callable(left, right, ignore_return=ignore_return)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\Users\\bers\\.pyenv-win-venv\\envs\\project_3.11\\Lib\\site-packages\\mypy\\subtypes.py\", line 1725, in unify_generic_callable\r\n applied = mypy.applytype.apply_generic_arguments(\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\Users\\bers\\.pyenv-win-venv\\envs\\project_3.11\\Lib\\site-packages\\mypy\\applytype.py\", line 170, in apply_generic_arguments\r\n arg_types=[expand_type(at, id_to_type) for at in callable.arg_types]\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\Users\\bers\\.pyenv-win-venv\\envs\\project_3.11\\Lib\\site-packages\\mypy\\applytype.py\", line 170, in \u003clistcomp>\r\n arg_types=[expand_type(at, id_to_type) for at in callable.arg_types]\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\Users\\bers\\.pyenv-win-venv\\envs\\project_3.11\\Lib\\site-packages\\mypy\\expandtype.py\", line 72, in expand_type\r\n return typ.accept(ExpandTypeVisitor(env))\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\Users\\bers\\.pyenv-win-venv\\envs\\project_3.11\\Lib\\site-packages\\mypy\\types.py\", line 1923, in accept\r\n return visitor.visit_callable_type(self)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\Users\\bers\\.pyenv-win-venv\\envs\\project_3.11\\Lib\\site-packages\\mypy\\expandtype.py\", line 435, in visit_callable_type\r\n arg_types = self.expand_types(t.arg_types)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\Users\\bers\\.pyenv-win-venv\\envs\\project_3.11\\Lib\\site-packages\\mypy\\expandtype.py\", line 542, in expand_types\r\n a.append(t.accept(self))\r\n ^^^^^^^^^^^^^^\r\n File \"C:\\Users\\bers\\.pyenv-win-venv\\envs\\project_3.11\\Lib\\site-packages\\mypy\\types.py\", line 1923, in accept\r\n return visitor.visit_callable_type(self)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\Users\\bers\\.pyenv-win-venv\\envs\\project_3.11\\Lib\\site-packages\\mypy\\expandtype.py\", line 435, in visit_callable_type\r\n arg_types = self.expand_types(t.arg_types)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"C:\\Users\\bers\\.pyenv-win-venv\\envs\\project_3.11\\Lib\\site-packages\\mypy\\expandtype.py\", line 542, in expand_types\r\n a.append(t.accept(self))\r\n ^^^^^^^^^^^^^^\r\n File \"C:\\Users\\bers\\.pyenv-win-venv\\envs\\project_3.11\\Lib\\site-packages\\mypy\\types.py\", line 1923, in accept\r\n return visitor.visit_callable_type(self)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n```\r\n\r\n(last three entries repeat)\r\n\r\n**To Reproduce**\r\n\r\nTrying to investigate https://github.com/python/mypy/issues/15594. Code is possibly nonsense.\r\n\r\n```python\r\nfrom typing import Callable, Concatenate, ParamSpec, TypeVar\r\n\r\nT = TypeVar(\"T\")\r\nP = ParamSpec(\"P\")\r\n\r\ndef decorator(\r\n caller_: Callable[Concatenate[Callable[P, T], P], T]\r\n) -> Callable[[Callable[P, T]], Callable[P, T]]:\r\n ...\r\n\r\n@decorator\r\ndef caller(callable: Callable[P, T], *args: P.args, **kwargs: P.kwargs) -> T:\r\n ...\r\n```\r\n\r\n**Your Environment**\r\n\r\n- Mypy version used: mypy-1.6.0+dev.5617cdd03d12ff73622c8d4b496979e0377b1675, possibly also 1.4.1\r\n- Mypy command-line flags: None\r\n- Mypy configuration options from `mypy.ini` (and other config files): None\r\n- Python version used: 3.11.4\r\n- Operating system and version: Windows","author":{"url":"https://github.com/bersbersbers","@type":"Person","name":"bersbersbers"},"datePublished":"2023-08-06T06:18:21Z","url":"https://github.com/python/mypy/issues/15824"}
| 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:d78082db-cba2-374b-f64f-5bbbf1a0ff42 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8310:197995:20A18E1:2C3ACA7:6B001DF6 |
| html-safe-nonce | 6737bad651fafd365ca1421e6e9a95f0defcde6c5228c6a55400d81dee72e41c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MzEwOjE5Nzk5NToyMEExOEUxOjJDM0FDQTc6NkIwMDFERjYiLCJ2aXNpdG9yX2lkIjoiMTc0MTQ5MjY0NDg0NTk4NTI3MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e7bfb5eae555303c776ff05c4e02eeb14c0bb85c7febe3b49b729593a49dcbd9 |
| hovercard-subject-tag | issue:1838069750 |
| 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/15824/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9d1f4ef12a5d0b502dd99b5b80a6e8704ec283d851705b4295f6a40057194dbc/python/mypy/issues/15824 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9d1f4ef12a5d0b502dd99b5b80a6e8704ec283d851705b4295f6a40057194dbc/python/mypy/issues/15824 |
| og:image:alt | Crash Report mypy crashes. Traceback (project_3.11) C:\Code>mypy mypy_1.5_crash.py --show-traceback mypy_1.5_crash.py:6: error: Missing return statement [empty-body] mypy_1.5_crash.py:12: error: Mi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bersbersbers |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0 |
| 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 | 44c658b24abf00491fb7ae5f56d42c9f38cbeab2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width