Title: Fix symbol table sub_table desync for non-simple annotation targets by youknowone · Pull Request #7300 · RustPython/RustPython · GitHub
Open Graph Title: Fix symbol table sub_table desync for non-simple annotation targets by youknowone · Pull Request #7300 · RustPython/RustPython
X Title: Fix symbol table sub_table desync for non-simple annotation targets by youknowone · Pull Request #7300 · RustPython/RustPython
Description: Non-simple annotations (subscript/attribute/parenthesized targets like a[0]: expr) were scanned in the annotation scope during symbol table analysis, creating sub_tables for any comprehensions. But codegen only compiles simple name annotations into annotate, so those sub_tables were never consumed. This caused subsequent simple annotations' comprehension sub_tables to get the wrong index, resulting in "the symbol 'X' must be present in the symbol table" errors. Fix: skip entering annotation scope for non-simple annotations since they are never compiled into annotate. Summary by CodeRabbit Refactor Adjusted how annotation scopes are treated so annotations are always handled as non-async. Improved annotation validation for assignment targets: retained detailed scanning for simple names while using safer validation for complex targets to avoid inconsistent internal annotation state.
Open Graph Description: Non-simple annotations (subscript/attribute/parenthesized targets like a[0]: expr) were scanned in the annotation scope during symbol table analysis, creating sub_tables for any comprehensions. But...
X Description: Non-simple annotations (subscript/attribute/parenthesized targets like a[0]: expr) were scanned in the annotation scope during symbol table analysis, creating sub_tables for any comprehensions. But...
Opengraph URL: https://github.com/RustPython/RustPython/pull/7300
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:0035a59a-4dc8-5424-3ff4-bfb3b9409cc6 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E76C:1DC30F:4B40F6A:61F2031:6A5D5507 |
| html-safe-nonce | 46c58d7635d157e23cc8952d894a9adc27ceacf331aeb9798b338dc44ded7566 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNzZDOjFEQzMwRjo0QjQwRjZBOjYxRjIwMzE6NkE1RDU1MDciLCJ2aXNpdG9yX2lkIjoiODgwNDQ1NzQ4OTk4MTMzMDY5NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c49a4468bb80bc7f63fa1d64a6cda79d147b5cec3af00fce0195d5f3b7e8b9ac |
| hovercard-subject-tag | pull_request:3341065905 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/RustPython/RustPython/pull/7300/files |
| twitter:image | https://avatars.githubusercontent.com/u/69878?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/69878?s=400&v=4 |
| og:image:alt | Non-simple annotations (subscript/attribute/parenthesized targets like a[0]: expr) were scanned in the annotation scope during symbol table analysis, creating sub_tables for any comprehensions. But... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git |
| octolytics-dimension-user_id | 39710557 |
| octolytics-dimension-user_login | RustPython |
| octolytics-dimension-repository_id | 135201145 |
| octolytics-dimension-repository_nwo | RustPython/RustPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 135201145 |
| octolytics-dimension-repository_network_root_nwo | RustPython/RustPython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width