-
-
Notifications
You must be signed in to change notification settings - Fork 670
fix(parser): forbid abstract class members with implementation in parser instead of semantic #14325
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
Conversation
…ser instead of semantic
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.
Pull Request Overview
This PR moves validation of abstract class members with implementation from semantic analysis to parser level, providing earlier error detection. The change ensures that abstract properties with initializers, abstract methods with implementations, and abstract accessors with implementations are caught during parsing rather than later semantic validation.
- Moves abstract member validation logic from semantic checker to parser
- Removes semantic validation functions and imports for abstract member checking
- Adds new parser diagnostic functions for abstract member validation errors
Reviewed Changes
Copilot reviewed 4 out of 8 changed files in this pull request and generated no comments.
File | Description |
---|---|
crates/oxc_semantic/src/checker/typescript.rs | Removes abstract member validation functions and import cleanup |
crates/oxc_semantic/src/checker/mod.rs | Removes property definition check call |
crates/oxc_parser/src/js/class.rs | Adds abstract member validation logic in property and method parsing |
crates/oxc_parser/src/diagnostics.rs | Adds new diagnostic functions for abstract member errors |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
CodSpeed Instrumentation Performance ReportMerging #14325 will not alter performanceComparing Summary
|
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.
Can't approve since I don't have access, but LGTM.
The following four cases are now errors in parser instead of semantic errors.
TS Playground for reference.
Closes #14013