Title: Regression: crash when serializing alias to generic class method · Issue #8072 · python/mypy · GitHub
Open Graph Title: Regression: crash when serializing alias to generic class method · Issue #8072 · python/mypy
X Title: Regression: crash when serializing alias to generic class method · Issue #8072 · python/mypy
Description: Type checking this program causes a crash during serialization of x: from typing import TypeVar T = TypeVar('T') class C: @classmethod def f(cls, x: T) -> T: ... x = C.f Here's the traceback: Traceback (most recent call last): File "/Lib...
Open Graph Description: Type checking this program causes a crash during serialization of x: from typing import TypeVar T = TypeVar('T') class C: @classmethod def f(cls, x: T) -> T: ... x = C.f Here's the traceback: Trace...
X Description: Type checking this program causes a crash during serialization of x: from typing import TypeVar T = TypeVar('T') class C: @classmethod def f(cls, x: T) -> T: ... x = C.f Here's the t...
Opengraph URL: https://github.com/python/mypy/issues/8072
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Regression: crash when serializing alias to generic class method","articleBody":"Type checking this program causes a crash during serialization of `x`:\r\n\r\n```py\r\nfrom typing import TypeVar\r\n\r\nT = TypeVar('T')\r\n\r\nclass C:\r\n @classmethod\r\n def f(cls, x: T) -> T: ...\r\n\r\nx = C.f\r\n```\r\n\r\nHere's the traceback:\r\n\r\n```\r\nTraceback (most recent call last):\r\n File \"/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/runpy.py\", line 193, in _run_module_as_main\r\n \"__main__\", mod_spec)\r\n File \"/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/runpy.py\", line 85, in _run_code\r\n exec(code, run_globals)\r\n File \"/Users/jukka/src/mypy/mypy/__main__.py\", line 12, in \u003cmodule>\r\n main(None, sys.stdout, sys.stderr)\r\n File \"/Users/jukka/src/mypy/mypy/main.py\", line 89, in main\r\n res = build.build(sources, options, None, flush_errors, fscache, stdout, stderr)\r\n File \"/Users/jukka/src/mypy/mypy/build.py\", line 167, in build\r\n sources, options, alt_lib_path, flush_errors, fscache, stdout, stderr, extra_plugins\r\n File \"/Users/jukka/src/mypy/mypy/build.py\", line 235, in _build\r\n graph = dispatch(sources, manager, stdout)\r\n File \"/Users/jukka/src/mypy/mypy/build.py\", line 2620, in dispatch\r\n process_graph(graph, manager)\r\n File \"/Users/jukka/src/mypy/mypy/build.py\", line 2929, in process_graph\r\n process_stale_scc(graph, scc, manager)\r\n File \"/Users/jukka/src/mypy/mypy/build.py\", line 3047, in process_stale_scc\r\n graph[id].write_cache()\r\n File \"/Users/jukka/src/mypy/mypy/build.py\", line 2244, in write_cache\r\n self.manager)\r\n File \"/Users/jukka/src/mypy/mypy/build.py\", line 1410, in write_cache\r\n data = tree.serialize()\r\n File \"/Users/jukka/src/mypy/mypy/nodes.py\", line 302, in serialize\r\n 'names': self.names.serialize(self._fullname),\r\n File \"/Users/jukka/src/mypy/mypy/nodes.py\", line 3083, in serialize\r\n data[key] = value.serialize(fullname, key)\r\n File \"/Users/jukka/src/mypy/mypy/nodes.py\", line 3021, in serialize\r\n data['node'] = self.node.serialize()\r\n File \"/Users/jukka/src/mypy/mypy/nodes.py\", line 882, in serialize\r\n 'type': None if self.type is None else self.type.serialize(),\r\n File \"/Users/jukka/src/mypy/mypy/types.py\", line 1218, in serialize\r\n 'arg_types': [t.serialize() for t in self.arg_types],\r\n File \"/Users/jukka/src/mypy/mypy/types.py\", line 1218, in \u003clistcomp>\r\n 'arg_types': [t.serialize() for t in self.arg_types],\r\n File \"/Users/jukka/src/mypy/mypy/types.py\", line 885, in serialize\r\n assert not self.id.is_meta_var()\r\nAssertionError\r\n```\r\n\r\nThis is a regression introduced in #8021.\r\n\r\ncc @ilevkivskyi ","author":{"url":"https://github.com/JukkaL","@type":"Person","name":"JukkaL"},"datePublished":"2019-12-04T14:58:34Z","url":"https://github.com/python/mypy/issues/8072"}
| 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:d4be166f-e0f8-f8e0-22c9-5f2301ab51fa |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9734:3677D1:10F9A96:160F4E6:6AFFF934 |
| html-safe-nonce | cb95a91e3e184f64c7539a0e65d2035f85c8d54dcf58adcf4ee795c78b343466 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NzM0OjM2NzdEMToxMEY5QTk2OjE2MEY0RTY6NkFGRkY5MzQiLCJ2aXNpdG9yX2lkIjoiNzI5NDkzMTE0NzIyMDMxODUxNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b96f8d0f4b9a24d4efd6f36e6be20548a598ebe2f22945d9be1c8cd570ad9b1f |
| hovercard-subject-tag | issue:532739276 |
| 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/8072/issue_layout |
| twitter:image | https://opengraph.githubassets.com/059052f4c7fc4f2be3c1a5cc6d19a0d42a9ebdf8ddd993f3aadc4a79ea3b3b99/python/mypy/issues/8072 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/059052f4c7fc4f2be3c1a5cc6d19a0d42a9ebdf8ddd993f3aadc4a79ea3b3b99/python/mypy/issues/8072 |
| og:image:alt | Type checking this program causes a crash during serialization of x: from typing import TypeVar T = TypeVar('T') class C: @classmethod def f(cls, x: T) -> T: ... x = C.f Here's the traceback: Trace... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JukkaL |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0a0d8686a27478df474dd7415776a7a080cde8838b3cd92ea7601187572e5729 |
| 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 | 16a11879678aaf97e2a42c33ee70830aa084fa37 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width