Title: Crash involving `ParamSpec`, `Concatenate` and `overloads` · Issue #12922 · python/mypy · GitHub
Open Graph Title: Crash involving `ParamSpec`, `Concatenate` and `overloads` · Issue #12922 · python/mypy
X Title: Crash involving `ParamSpec`, `Concatenate` and `overloads` · Issue #12922 · python/mypy
Description: Crash Report The following snippet of code causes a mypy crash: from typing import ParamSpec, TypeVar, Concatenate, Callable, overload P = ParamSpec("P") R = TypeVar("R") S = TypeVar("S") @overload def bar(x: Callable[Concatenate[S, P], ...
Open Graph Description: Crash Report The following snippet of code causes a mypy crash: from typing import ParamSpec, TypeVar, Concatenate, Callable, overload P = ParamSpec("P") R = TypeVar("R") S = TypeVar("S") @overload...
X Description: Crash Report The following snippet of code causes a mypy crash: from typing import ParamSpec, TypeVar, Concatenate, Callable, overload P = ParamSpec("P") R = TypeVar("R") S = Ty...
Opengraph URL: https://github.com/python/mypy/issues/12922
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Crash involving `ParamSpec`, `Concatenate` and `overloads`","articleBody":"**Crash Report**\r\n\r\nThe following snippet of code causes a mypy crash:\r\n\r\n```python\r\nfrom typing import ParamSpec, TypeVar, Concatenate, Callable, overload\r\n\r\nP = ParamSpec(\"P\")\r\nR = TypeVar(\"R\")\r\nS = TypeVar(\"S\")\r\n\r\n@overload\r\ndef bar(x: Callable[Concatenate[S, P], R]) -> str: ...\r\n@overload\r\ndef bar(x: Callable[P, R]) -> int: ...\r\ndef bar(x: Callable[..., R]) -> str | int: ...\r\n```\r\n\r\nDiscovered in https://github.com/python/typeshed/pull/7771.\r\n\r\n\r\n**Mypy output**\r\n\r\n```\r\nTraceback (most recent call last):\r\n File \"/opt/python3.9/lib/python3.9/runpy.py\", line 197, in _run_module_as_main\r\n return _run_code(code, main_globals, None,\r\n File \"/opt/python3.9/lib/python3.9/runpy.py\", line 87, in _run_code\r\n exec(code, run_globals)\r\n File \"mypy/checker.py\", line 431, in accept\r\n File \"mypy/nodes.py\", line 581, in accept\r\n File \"mypy/checker.py\", line 464, in visit_overloaded_func_def\r\n File \"mypy/checker.py\", line 491, in _visit_overloaded_func_def\r\n File \"mypy/checker.py\", line 573, in check_overlapping_overloads\r\n File \"mypy/checker.py\", line 6118, in is_unsafe_overlapping_overload_signatures\r\n File \"mypy/subtypes.py\", line 982, in is_callable_compatible\r\n File \"mypy/subtypes.py\", line 1051, in are_parameters_compatible\r\n File \"mypy/subtypes.py\", line 1178, in are_args_compatible\r\n File \"mypy/subtypes.py\", line 1183, in new_is_compat\r\n File \"mypy/checker.py\", line 6603, in is_overlapping_types_no_promote\r\n File \"mypy/meet.py\", line 335, in is_overlapping_types\r\n File \"mypy/subtypes.py\", line 982, in is_callable_compatible\r\n File \"mypy/subtypes.py\", line 1039, in are_parameters_compatible\r\n File \"mypy/subtypes.py\", line 1037, in _incompatible\r\n File \"mypy/meet.py\", line 181, in _is_overlapping_types\r\n File \"mypy/meet.py\", line 401, in is_overlapping_types\r\nAssertionError: \r\nmain.py:7: 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: 0.960\r\nmain.py:7: : note: use --pdb to drop into pdb\r\n```\r\n\r\nNote that this is a very similar traceback to #12322, but I have no idea if it's the same issue, since #12322 doesn't have a minimal repro.\r\n\r\n**To Reproduce**\r\n\r\nhttps://mypy-play.net/?mypy=latest&python=3.10&flags=show-traceback&gist=13ea15dacce1cac389fbd26c5fca569f\r\n\r\n**Your Environment**\r\n\r\n- Mypy version used: 0.960\r\n- Python version used: 3.10\r\n","author":{"url":"https://github.com/AlexWaygood","@type":"Person","name":"AlexWaygood"},"datePublished":"2022-06-01T15:29:14Z","url":"https://github.com/python/mypy/issues/12922"}
| 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:cc79fe67-8ebb-e37b-129c-858f40e7595a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A16A:BACA4:2E85790:3D9B7AD:6B0029CB |
| html-safe-nonce | 7f8d86e95bcca713fb22476472d0f2f659993381f05763ecc5a97971951410f4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMTZBOkJBQ0E0OjJFODU3OTA6M0Q5QjdBRDo2QjAwMjlDQiIsInZpc2l0b3JfaWQiOiI0MzgxMzAwMzE1MTUyOTg0NTIzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 77c4c8069b0444fd2af229b837f2255a394a66a9619cd88eff9d6c479e54634f |
| hovercard-subject-tag | issue:1256291129 |
| 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/12922/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6297115f482365972cdc72beb7c05d9681b950a28425337dd150a36729bbdfac/python/mypy/issues/12922 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6297115f482365972cdc72beb7c05d9681b950a28425337dd150a36729bbdfac/python/mypy/issues/12922 |
| og:image:alt | Crash Report The following snippet of code causes a mypy crash: from typing import ParamSpec, TypeVar, Concatenate, Callable, overload P = ParamSpec("P") R = TypeVar("R") S = TypeVar("S") @overload... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | AlexWaygood |
| 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