Title: [1.16 regression] crashes on invalid and self-referential setter · Issue #19205 · python/mypy · GitHub
Open Graph Title: [1.16 regression] crashes on invalid and self-referential setter · Issue #19205 · python/mypy
X Title: [1.16 regression] crashes on invalid and self-referential setter · Issue #19205 · python/mypy
Description: Crash Report (Tell us what happened.) Traceback xtf-py3.12vfazio@vfazio4 /mnt/development/xtf $ mypy --show-traceback simple.py simple.py:24: error: INTERNAL ERROR -- Please try using mypy master on GitHub: https://mypy.readthedocs.io/en...
Open Graph Description: Crash Report (Tell us what happened.) Traceback xtf-py3.12vfazio@vfazio4 /mnt/development/xtf $ mypy --show-traceback simple.py simple.py:24: error: INTERNAL ERROR -- Please try using mypy master o...
X Description: Crash Report (Tell us what happened.) Traceback xtf-py3.12vfazio@vfazio4 /mnt/development/xtf $ mypy --show-traceback simple.py simple.py:24: error: INTERNAL ERROR -- Please try using mypy master o...
Opengraph URL: https://github.com/python/mypy/issues/19205
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[1.16 regression] crashes on invalid and self-referential setter","articleBody":"\u003c!--\n Use this form only if mypy reports an \"INTERNAL ERROR\" and/or gives a traceback.\n Please include the traceback and all other messages below (use `mypy --show-traceback`).\n-->\n\n**Crash Report**\n\n(Tell us what happened.)\n\n**Traceback**\n\n```\nxtf-py3.12vfazio@vfazio4 /mnt/development/xtf $ mypy --show-traceback simple.py \nsimple.py:24: 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.17.0+dev.04afa499f936f671ee3f5a53edf3f5c8df18e76c\nTraceback (most recent call last):\n File \"/mnt/development/xtf/.venv/bin/mypy\", line 8, in \u003cmodule>\n sys.exit(console_entry())\n File \"/mnt/development/xtf/.venv/lib/python3.12/site-packages/mypy/__main__.py\", line 15, in console_entry\n main()\n File \"/mnt/development/xtf/.venv/lib/python3.12/site-packages/mypy/main.py\", line 127, in main\n res, messages, blockers = run_build(sources, options, fscache, t0, stdout, stderr)\n File \"/mnt/development/xtf/.venv/lib/python3.12/site-packages/mypy/main.py\", line 211, in run_build\n res = build.build(sources, options, None, flush_errors, fscache, stdout, stderr)\n File \"/mnt/development/xtf/.venv/lib/python3.12/site-packages/mypy/build.py\", line 191, in build\n result = _build(\n File \"/mnt/development/xtf/.venv/lib/python3.12/site-packages/mypy/build.py\", line 267, in _build\n graph = dispatch(sources, manager, stdout)\n File \"/mnt/development/xtf/.venv/lib/python3.12/site-packages/mypy/build.py\", line 2939, in dispatch\n process_graph(graph, manager)\n File \"/mnt/development/xtf/.venv/lib/python3.12/site-packages/mypy/build.py\", line 3337, in process_graph\n process_stale_scc(graph, scc, manager)\n File \"/mnt/development/xtf/.venv/lib/python3.12/site-packages/mypy/build.py\", line 3438, in process_stale_scc\n graph[id].type_check_first_pass()\n File \"/mnt/development/xtf/.venv/lib/python3.12/site-packages/mypy/build.py\", line 2311, in type_check_first_pass\n self.type_checker().check_first_pass()\n File \"/mnt/development/xtf/.venv/lib/python3.12/site-packages/mypy/checker.py\", line 471, in check_first_pass\n self.accept(d)\n File \"/mnt/development/xtf/.venv/lib/python3.12/site-packages/mypy/checker.py\", line 578, in accept\n stmt.accept(self)\n File \"/mnt/development/xtf/.venv/lib/python3.12/site-packages/mypy/nodes.py\", line 1216, in accept\n return visitor.visit_class_def(self)\n File \"/mnt/development/xtf/.venv/lib/python3.12/site-packages/mypy/checker.py\", line 2542, in visit_class_def\n self.accept(defn.defs)\n File \"/mnt/development/xtf/.venv/lib/python3.12/site-packages/mypy/checker.py\", line 578, in accept\n stmt.accept(self)\n File \"/mnt/development/xtf/.venv/lib/python3.12/site-packages/mypy/nodes.py\", line 1297, in accept\n return visitor.visit_block(self)\n File \"/mnt/development/xtf/.venv/lib/python3.12/site-packages/mypy/checker.py\", line 3031, in visit_block\n self.accept(s)\n File \"/mnt/development/xtf/.venv/lib/python3.12/site-packages/mypy/checker.py\", line 578, in accept\n stmt.accept(self)\n File \"/mnt/development/xtf/.venv/lib/python3.12/site-packages/mypy/nodes.py\", line 590, in accept\n return visitor.visit_overloaded_func_def(self)\n File \"/mnt/development/xtf/.venv/lib/python3.12/site-packages/mypy/checker.py\", line 663, in visit_overloaded_func_def\n self._visit_overloaded_func_def(defn)\n File \"/mnt/development/xtf/.venv/lib/python3.12/site-packages/mypy/checker.py\", line 682, in _visit_overloaded_func_def\n self.visit_decorator_inner(defn.items[1], skip_first_item=True)\n File \"/mnt/development/xtf/.venv/lib/python3.12/site-packages/mypy/checker.py\", line 5249, in visit_decorator_inner\n self.check_func_item(e.func, name=e.func.name, allow_empty=allow_empty)\n File \"/mnt/development/xtf/.venv/lib/python3.12/site-packages/mypy/checker.py\", line 1170, in check_func_item\n self.check_func_def(defn, typ, name, allow_empty)\n File \"/mnt/development/xtf/.venv/lib/python3.12/site-packages/mypy/checker.py\", line 1457, in check_func_def\n self.accept(item.body)\n File \"/mnt/development/xtf/.venv/lib/python3.12/site-packages/mypy/checker.py\", line 578, in accept\n stmt.accept(self)\n File \"/mnt/development/xtf/.venv/lib/python3.12/site-packages/mypy/nodes.py\", line 1297, in accept\n return visitor.visit_block(self)\n File \"/mnt/development/xtf/.venv/lib/python3.12/site-packages/mypy/checker.py\", line 3031, in visit_block\n self.accept(s)\n File \"/mnt/development/xtf/.venv/lib/python3.12/site-packages/mypy/checker.py\", line 578, in accept\n stmt.accept(self)\n File \"/mnt/development/xtf/.venv/lib/python3.12/site-packages/mypy/nodes.py\", line 1384, in accept\n return visitor.visit_assignment_stmt(self)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/mnt/development/xtf/.venv/lib/python3.12/site-packages/mypy/checker.py\", line 3080, in visit_assignment_stmt\n self.check_assignment(s.lvalues[-1], s.rvalue, s.type is None, s.new_syntax)\n File \"/mnt/development/xtf/.venv/lib/python3.12/site-packages/mypy/checker.py\", line 3141, in check_assignment\n lvalue_type, index_lvalue, inferred = self.check_lvalue(lvalue, rvalue)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/mnt/development/xtf/.venv/lib/python3.12/site-packages/mypy/checker.py\", line 4245, in check_lvalue\n lvalue_type = self.expr_checker.analyze_ordinary_member_access(lvalue, True, rvalue)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/mnt/development/xtf/.venv/lib/python3.12/site-packages/mypy/checkexpr.py\", line 3333, in analyze_ordinary_member_access\n member_type = analyze_member_access(\n ^^^^^^^^^^^^^^^^^^^^^^\n File \"/mnt/development/xtf/.venv/lib/python3.12/site-packages/mypy/checkmember.py\", line 226, in analyze_member_access\n result = _analyze_member_access(name, typ, mx, override_info)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/mnt/development/xtf/.venv/lib/python3.12/site-packages/mypy/checkmember.py\", line 243, in _analyze_member_access\n return analyze_instance_member_access(name, typ, mx, override_info)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/mnt/development/xtf/.venv/lib/python3.12/site-packages/mypy/checkmember.py\", line 350, in analyze_instance_member_access\n return analyze_var(name, getter.var, typ, mx)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/mnt/development/xtf/.venv/lib/python3.12/site-packages/mypy/checkmember.py\", line 925, in analyze_var\n item = expand_and_bind_callable(p_ct, var, itype, name, mx, is_trivial_self)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/mnt/development/xtf/.venv/lib/python3.12/site-packages/mypy/checkmember.py\", line 984, in expand_and_bind_callable\n return expanded.arg_types[0]\n ~~~~~~~~~~~~~~~~~~^^^\nIndexError: list index out of range\nsimple.py:24: : note: use --pdb to drop into pdb\n```\n\n**To Reproduce**\n\n(Write what you did to reproduce the crash. Full source code is\nappreciated. We also very much appreciate it if you try to narrow the\nsource down to a small stand-alone example.)\n\n```python\nfrom typing import TYPE_CHECKING, Any, ClassVar, TypeVar\n\nclass NoopPowerResource:\n _hardware_type = None\n\n @property\n def hardware_type(self) -> Any:\n return self._hardware_type\n\n @hardware_type.setter\n def hardware_type(self) -> None:\n self.hardware_type = None\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.16.0 + 1.17.0+dev.04afa499f936f671ee3f5a53edf3f5c8df18e76c\n- Mypy command-line flags:\n- Mypy configuration options from `mypy.ini` (and other config files):\n- Python version used: CPython 3.12.4\n- Operating system and version: Ubuntu 22.04\n\n\u003c!--\nYou can freely edit this text, please remove all the lines\nyou believe are unnecessary.\n-->\n","author":{"url":"https://github.com/vfazio","@type":"Person","name":"vfazio"},"datePublished":"2025-06-02T12:03:05Z","url":"https://github.com/python/mypy/issues/19205"}
| 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:5aa0a7c4-8644-6abb-ca34-c9f04c59cf00 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8792:3C2A9A:14E90B5:1B6CAC0:6B000CB8 |
| html-safe-nonce | 02bc548eca045a7a686c0aa39a7e74d7791a5168be101dadc97bcf6b8d3fd7ee |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NzkyOjNDMkE5QToxNEU5MEI1OjFCNkNBQzA6NkIwMDBDQjgiLCJ2aXNpdG9yX2lkIjoiNjQ3ODk5MjI0ODM3NjY1OTEyOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 04f351065f756321a88cbcb9bb3b7f9949c3586f5600277b8ba683fcc1dae2b4 |
| hovercard-subject-tag | issue:3109893448 |
| 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/19205/issue_layout |
| twitter:image | https://opengraph.githubassets.com/bbc0309ead20fb350c440adc6fabcc389e42c5b560edd3521406c77bb3a68677/python/mypy/issues/19205 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/bbc0309ead20fb350c440adc6fabcc389e42c5b560edd3521406c77bb3a68677/python/mypy/issues/19205 |
| og:image:alt | Crash Report (Tell us what happened.) Traceback xtf-py3.12vfazio@vfazio4 /mnt/development/xtf $ mypy --show-traceback simple.py simple.py:24: error: INTERNAL ERROR -- Please try using mypy master o... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | vfazio |
| hostname | github.com |
| expected-hostname | github.com |
| None | cf7ee0062053ad9eb05b6e5de57bd96c2055708bcbada4144946b5ec129cf1d7 |
| 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 | 9cab7de176a56362d2aabcbb4d1e07e846eba8a0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width