| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
| Back | FazBrowse Home | New Git URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality⚠️ Potential issue | 🟡 Minor
🧩 Analysis chain🏁 Script executed:
Repository: RustPython/RustPython
Length of output: 5185
🏁 Script executed:
Repository: RustPython/RustPython
Length of output: 7084
🏁 Script executed:
Repository: RustPython/RustPython
Length of output: 2935
🏁 Script executed:
Repository: RustPython/RustPython
Length of output: 1106
Super-call eligibility checks: align __class__ scope handling with load_args_for_super().
The 0-arg super() path rejects __class__ unless it's Free or has the FREE_CLASS flag (lines 759–760), but load_args_for_super() explicitly handles SymbolScope::Cell (line 795). This inconsistency may unnecessarily block valid optimizations when __class__ is scoped as Cell in the method.
Proposed fixif let Some(symbol) = table.lookup("__class__") { - if symbol.scope != SymbolScope::Free - && !symbol.flags.contains(SymbolFlags::FREE_CLASS) + if !matches!(symbol.scope, SymbolScope::Free | SymbolScope::Cell) + && !symbol.flags.contains(SymbolFlags::FREE_CLASS) { return None; }In @crates/codegen/src/compile.rs around lines 676 - 773, can_optimize_super_call rejects 0-arg super() when __class__ is not SymbolScope::Free or lacks FREE_CLASS, but load_args_for_super also accepts SymbolScope::Cell; update can_optimize_super_call to treat SymbolScope::Cell as acceptable (i.e., allow optimization when table.lookup("__class__") returns a symbol whose scope is Free or Cell or whose flags contain FREE_CLASS) so eligibility matches load_args_for_super; reference functions can_optimize_super_call and load_args_for_super and the symbol/name "__class__" and SymbolScope::Cell/FREE_CLASS.Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.