◐ Shell
clean mode source ↗

Remove misplaced SymbolScope::TypeParams by youknowone · Pull Request #5975 · RustPython/RustPython

compiler/codegen/src/compile.rs (6)

412-412: LGTM: Function parameter type correctly updated

The function parameter type change from SymbolTableType to CompilerScope is correct and aligns with the systematic enum replacement throughout the codebase.


455-455: LGTM: Debug assertions correctly updated

The debug assertions are properly updated to use CompilerScope::Class instead of the old enum variant, maintaining the same validation logic.

Also applies to: 462-462


482-502: LGTM: Match arms comprehensively updated

The match arms are systematically updated to use CompilerScope variants. The logic correctly handles all scope types including the new AsyncFunction variant and the TypeParams variant (which is now properly scoped as a compiler scope rather than a symbol scope).


533-533: LGTM: Scope type comparisons correctly updated

All comparisons with scope types are properly updated to use CompilerScope variants, maintaining the same conditional logic with the new enum type.

Also applies to: 547-547, 552-552, 572-572


953-953: LGTM: Commented code appropriately documents removed variant

The commented line indicates that SymbolScope::Unknown was removed as part of this refactoring, which is appropriate since it's no longer needed in the current implementation.


2203-2203: LGTM: Function call correctly updated

The call to enter_scope is properly updated to pass CompilerScope::Class instead of the old enum variant, maintaining the same functionality.

compiler/codegen/src/symboltable.rs (11)

34-34: LGTM: Enum type correctly updated.

The type annotation has been properly updated from SymbolTableType to CompilerScope.


60-60: LGTM: Function parameter type correctly updated.

The parameter type has been properly updated to use CompilerScope.


91-99: LGTM: Enum renaming and extension looks good.

The enum has been properly renamed from SymbolTableType to CompilerScope with the addition of the AsyncFunction variant. The variant naming is consistent with the existing pattern.


101-119: LGTM: Display implementation correctly updated.

The Display trait implementation has been properly updated to handle the new enum name and includes the new AsyncFunction variant with appropriate formatting.


537-537: LGTM: Comprehensive async function handling.

The match arm correctly includes all function-like scopes including the new AsyncFunction variant alongside Function and Lambda. This ensures consistent handling of async functions in symbol analysis.


641-641: LGTM: Module scope initialization correctly updated.

The top-level scope initialization properly uses the new CompilerScope::Module enum reference.


656-656: LGTM: Function signature correctly updated.

The function parameter type has been properly updated to use CompilerScope.


660-660: LGTM: Enum reference correctly updated.

The comparison properly uses the new CompilerScope::Function enum reference.


751-751: LGTM: Type parameter scope references correctly updated.

All references to CompilerScope::TypeParams are properly updated and consistent throughout the file.

Also applies to: 779-779, 971-971


1456-1456: LGTM: Function scope creation correctly updated.

The function scope creation properly uses the new CompilerScope::Function enum reference.


326-326: LGTM: All remaining enum references correctly updated.

All remaining references to the enum have been systematically and correctly updated from SymbolTableType to CompilerScope throughout the file. The changes are consistent and maintain the correct functionality.

Also applies to: 352-352, 362-362, 368-368, 432-433, 455-455, 480-480, 485-485, 526-526, 529-529, 555-555, 586-586, 1173-1173, 1193-1193, 1259-1259, 1290-1290