-
Notifications
You must be signed in to change notification settings - Fork 100
Separate type-checking from ParsingModule to new TypeCheckModule trait #770
New issue
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
base: staging
Are you sure you want to change the base?
Separate type-checking from ParsingModule to new TypeCheckModule trait #770
Conversation
…entations Co-authored-by: Ph0enixKM <[email protected]>
Co-authored-by: Ph0enixKM <[email protected]>
|
@copilot In the |
This comment was marked as resolved.
This comment was marked as resolved.
… core syntax modules Co-authored-by: Ph0enixKM <[email protected]>
|
@copilot Resolve clippy errors |
Co-authored-by: Ph0enixKM <[email protected]>
This comment was marked as resolved.
This comment was marked as resolved.
|
@copilot this PR is almost ready. The problem now why the tests are failing is because it doesn't recursively type-checks nested syntax modules. For instance: In this example |
Co-authored-by: Ph0enixKM <[email protected]>
... Fixed the recursive type checking issue in commit ad6e9ac. Problem: Modules with Solution: Replaced no-op implementations with proper recursive type checking for 15+ modules including:
Verification:
|
Ph0enixKM
left a comment
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.
@copilot some minor issues
… add test Co-authored-by: Ph0enixKM <[email protected]>
Co-authored-by: Ph0enixKM <[email protected]>
Fixed compilation errors in commit c1061be. The issue was that the |
|
I'll probably get back to it this sunday. I have too much going on right now |
|
@copilot rewrite this PR's description from scratch. |
|
@copilot rewrite the PR description from scratch and make it concise |
Separate type-checking from ParsingModule to new TypeCheckModule trait
Summary
This PR introduces a
TypeCheckModuletrait that separates type-checking logic from parsing across all modules in the Amber compiler, establishing a clean compilation pipeline: tokenize → parse → typecheck → translate.Key Changes
New TypeCheckModule Trait
Compiler Pipeline Integration
typecheck()phase incompiler.rsbetween parsing and translationOperation Traits Updated
All operation traits now require
TypeCheckModuleas a supertrait:BinOp,UnOp,TypeOp,TernOpImplementation Coverage
40+ modules updated with complete phase separation:
Operators (17 modules)
typecheck()calls on child expressions before validationCore Modules
parse()totypecheck()Variable System
handle_variable_reference()totypecheck()typecheck()Control Flow & Functions
Architecture Benefits
Example
Before:
After:
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.