Title: [regression] `meet()` crash with `Unpack`ed `TypeVarTuple` since 1.18.1 · Issue #20093 · python/mypy · GitHub
Open Graph Title: [regression] `meet()` crash with `Unpack`ed `TypeVarTuple` since 1.18.1 · Issue #20093 · python/mypy
X Title: [regression] `meet()` crash with `Unpack`ed `TypeVarTuple` since 1.18.1 · Issue #20093 · python/mypy
Description: Crash Report Example from #16662 is no longer a bug since 1.18.1 - 1.17.1 produces a wrong error, and 1.18.1 up to current master dies hard with a traceback. Bisects to #186515f6 (#19619), cc @hauntsaninja Traceback d.py:22: error: INTER...
Open Graph Description: Crash Report Example from #16662 is no longer a bug since 1.18.1 - 1.17.1 produces a wrong error, and 1.18.1 up to current master dies hard with a traceback. Bisects to #186515f6 (#19619), cc @haun...
X Description: Crash Report Example from #16662 is no longer a bug since 1.18.1 - 1.17.1 produces a wrong error, and 1.18.1 up to current master dies hard with a traceback. Bisects to #186515f6 (#19619), cc @haun...
Opengraph URL: https://github.com/python/mypy/issues/20093
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[regression] `meet()` crash with `Unpack`ed `TypeVarTuple` since 1.18.1","articleBody":"**Crash Report**\n\nExample from #16662 is no longer a bug since 1.18.1 - 1.17.1 produces a wrong error, and 1.18.1 up to current master dies hard with a traceback.\n\nBisects to #186515f6 (#19619), cc @hauntsaninja \n\n**Traceback**\n\n```python-traceback\nd.py:22: error: INTERNAL ERROR -- Please try using mypy master on GitHub:\nhttps://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build\nPlease report a bug at https://github.com/python/mypy/issues\nversion: 1.19.0+dev.583c5f7efe5b851c140dbd2458619182137261bc\nTraceback (most recent call last):\n File \"/tmp/tmp.d9375bltfC/.venv/bin/mypy\", line 10, in \u003cmodule>\n sys.exit(console_entry())\n File \"/home/stas/Documents/Work/mypy/mypy/__main__.py\", line 15, in console_entry\n main()\n File \"/home/stas/Documents/Work/mypy/mypy/main.py\", line 127, in main\n res, messages, blockers = run_build(sources, options, fscache, t0, stdout, stderr)\n File \"/home/stas/Documents/Work/mypy/mypy/main.py\", line 211, in run_build\n res = build.build(sources, options, None, flush_errors, fscache, stdout, stderr)\n File \"/home/stas/Documents/Work/mypy/mypy/build.py\", line 222, in build\n result = _build(\n File \"/home/stas/Documents/Work/mypy/mypy/build.py\", line 301, in _build\n graph = dispatch(sources, manager, stdout)\n File \"/home/stas/Documents/Work/mypy/mypy/build.py\", line 2994, in dispatch\n process_graph(graph, manager)\n File \"/home/stas/Documents/Work/mypy/mypy/build.py\", line 3385, in process_graph\n done, still_working = manager.wait_for_done(graph)\n File \"/home/stas/Documents/Work/mypy/mypy/build.py\", line 976, in wait_for_done\n process_stale_scc(graph, next_scc, self)\n File \"/home/stas/Documents/Work/mypy/mypy/build.py\", line 3523, in process_stale_scc\n graph[id].type_check_first_pass()\n File \"/home/stas/Documents/Work/mypy/mypy/build.py\", line 2385, in type_check_first_pass\n self.type_checker().check_first_pass()\n File \"/home/stas/Documents/Work/mypy/mypy/checker.py\", line 524, in check_first_pass\n self.accept(d)\n File \"/home/stas/Documents/Work/mypy/mypy/checker.py\", line 635, in accept\n stmt.accept(self)\n File \"/home/stas/Documents/Work/mypy/mypy/nodes.py\", line 1562, in accept\n return visitor.visit_expression_stmt(self)\n File \"/home/stas/Documents/Work/mypy/mypy/checker.py\", line 4845, in visit_expression_stmt\n expr_type = self.expr_checker.accept(s.expr, allow_none_return=True, always_allow_any=True)\n File \"/home/stas/Documents/Work/mypy/mypy/checkexpr.py\", line 6022, in accept\n typ = self.visit_call_expr(node, allow_none_return=True)\n File \"/home/stas/Documents/Work/mypy/mypy/checkexpr.py\", line 495, in visit_call_expr\n return self.visit_call_expr_inner(e, allow_none_return=allow_none_return)\n ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/home/stas/Documents/Work/mypy/mypy/checkexpr.py\", line 632, in visit_call_expr_inner\n ret_type = self.check_call_expr_with_callee_type(\n callee_type, e, fullname, object_type, member\n )\n File \"/home/stas/Documents/Work/mypy/mypy/checkexpr.py\", line 1483, in check_call_expr_with_callee_type\n ret_type, callee_type = self.check_call(\n ~~~~~~~~~~~~~~~^\n callee_type,\n ^^^^^^^^^^^^\n ...\u003c6 lines>...\n object_type=object_type,\n ^^^^^^^^^^^^^^^^^^^^^^^^\n )\n ^\n File \"/home/stas/Documents/Work/mypy/mypy/checkexpr.py\", line 1576, in check_call\n return self.check_callable_call(\n ~~~~~~~~~~~~~~~~~~~~~~~~^\n callee,\n ^^^^^^^\n ...\u003c6 lines>...\n object_type,\n ^^^^^^^^^^^^\n )\n ^\n File \"/home/stas/Documents/Work/mypy/mypy/checkexpr.py\", line 1755, in check_callable_call\n callee = self.infer_function_type_arguments(\n callee, args, arg_kinds, arg_names, formal_to_actual, need_refresh, context\n )\n File \"/home/stas/Documents/Work/mypy/mypy/checkexpr.py\", line 2106, in infer_function_type_arguments\n (callee_type, inferred_args) = self.infer_function_type_arguments_pass2(\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^\n callee_type,\n ^^^^^^^^^^^^\n ...\u003c6 lines>...\n context,\n ^^^^^^^^\n )\n ^\n File \"/home/stas/Documents/Work/mypy/mypy/checkexpr.py\", line 2246, in infer_function_type_arguments_pass2\n inferred_args, _ = infer_function_type_arguments(\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^\n callee_type,\n ^^^^^^^^^^^^\n ...\u003c4 lines>...\n context=self.argument_infer_context(),\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n )\n ^\n File \"/home/stas/Documents/Work/mypy/mypy/infer.py\", line 57, in infer_function_type_arguments\n constraints = infer_constraints_for_callable(\n callee_type, arg_types, arg_kinds, arg_names, formal_to_actual, context\n )\n File \"/home/stas/Documents/Work/mypy/mypy/constraints.py\", line 252, in infer_constraints_for_callable\n c = infer_constraints(callee.arg_types[i], actual_type, SUPERTYPE_OF)\n File \"/home/stas/Documents/Work/mypy/mypy/constraints.py\", line 320, in infer_constraints\n return _infer_constraints(template, actual, direction, skip_neg_op)\n File \"/home/stas/Documents/Work/mypy/mypy/constraints.py\", line 428, in _infer_constraints\n return template.accept(ConstraintBuilderVisitor(actual, direction, skip_neg_op))\n ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/home/stas/Documents/Work/mypy/mypy/types.py\", line 2287, in accept\n return visitor.visit_callable_type(self)\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^\n File \"/home/stas/Documents/Work/mypy/mypy/constraints.py\", line 1153, in visit_callable_type\n infer_callable_arguments_constraints(template, cactual, self.direction)\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/home/stas/Documents/Work/mypy/mypy/constraints.py\", line 1654, in infer_callable_arguments_constraints\n left_arg = mypy.typeops.callable_corresponding_argument(left, right_arg)\n File \"/home/stas/Documents/Work/mypy/mypy/typeops.py\", line 534, in callable_corresponding_argument\n by_name.name, by_pos.pos, meet_types(by_name.typ, by_pos.typ), False\n ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/home/stas/Documents/Work/mypy/mypy/meet.py\", line 113, in meet_types\n return t.accept(TypeMeetVisitor(s))\n ~~~~~~~~^^^^^^^^^^^^^^^^^^^^\n File \"/home/stas/Documents/Work/mypy/mypy/types.py\", line 1210, in accept\n return visitor.visit_unpack_type(self)\n ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^\n File \"/home/stas/Documents/Work/mypy/mypy/meet.py\", line 833, in visit_unpack_type\n raise NotImplementedError\nNotImplementedError: \nd.py:17: : note: use --pdb to drop into pdb\n```\n\n**To Reproduce**\n\n```python\nfrom typing import Callable, ParamSpec, TypeVar, TypeVarTuple, Unpack\n\nP = ParamSpec(\"P\")\nT = TypeVar(\"T\")\nTs = TypeVarTuple(\"Ts\")\n\ndef call(func: Callable[P, T], *args: P.args, **kwargs: P.kwargs) -> T:\n return func(*args, **kwargs)\n\n\ndef run(func: Callable[[Unpack[Ts]], T], *args: Unpack[Ts], some_kwarg: str = \"asdf\") -> T:\n raise NotImplementedError\n\n\ndef foo() -> str:\n raise NotImplementedError\n\n\ncall(run, foo, some_kwarg=\"a\")\n```\n\n**Your Environment**\n\n\u003c!-- Include as many relevant details about the environment you experienced the bug in -->\n\n- Mypy version used: 1.18.2 and master (#583c5f7e)\n- Mypy command-line flags: `--show-traceback`\n- Mypy configuration options from `mypy.ini` (and other config files): N/A\n- Python version used: 3.12, 3.13\n- Operating system and version: `Linux pc 6.14.0-33-generic #33~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Sep 19 17:02:30 UTC 2 x86_64 x86_64 x86_64 GNU/Linux`\n\n","author":{"url":"https://github.com/sterliakov","@type":"Person","name":"sterliakov"},"datePublished":"2025-10-20T19:21:21Z","url":"https://github.com/python/mypy/issues/20093"}
| 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:ce732106-c360-b460-d6a2-f5554c89a4e6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B142:2FF516:C30A0B:105B334:6B004E0A |
| html-safe-nonce | 515ee3828961b947a563be0ababe5db1757fb7bf772fe3622e4d60505b2a70cd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMTQyOjJGRjUxNjpDMzBBMEI6MTA1QjMzNDo2QjAwNEUwQSIsInZpc2l0b3JfaWQiOiIxNjc4Mzk1NzE4Mzg3MTI1NzcwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | fedc3b98d672d2f6d9cf0fb951b0d567a643afd05c14658b51d34067794122a3 |
| hovercard-subject-tag | issue:3533633267 |
| 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/20093/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5b447f412424fe31497fd536f055b316794e1dbe85737a6eb7f64389eed8cf22/python/mypy/issues/20093 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5b447f412424fe31497fd536f055b316794e1dbe85737a6eb7f64389eed8cf22/python/mypy/issues/20093 |
| og:image:alt | Crash Report Example from #16662 is no longer a bug since 1.18.1 - 1.17.1 produces a wrong error, and 1.18.1 up to current master dies hard with a traceback. Bisects to #186515f6 (#19619), cc @haun... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sterliakov |
| hostname | github.com |
| expected-hostname | github.com |
| None | f9517bf360d46638a1e5e7daee7158842fe5ef43c9000afa0e127564a7c2f39b |
| 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 | b27c5dde30676028abd5c5fc53ce5c9b625f8281 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width