fix(semantic): report TS18019 for abstract modifier with private identifier#18173
fix(semantic): report TS18019 for abstract modifier with private identifier#18173graphite-app[bot] merged 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds semantic validation for TypeScript error TS18019, which prevents the use of the abstract modifier with private identifiers in class members. This addresses a gap in the semantic checker where abstract private members were previously accepted without error.
Changes:
- Added new diagnostic function
abstract_cannot_be_used_with_private_identifierwith TS error code 18019 - Implemented validation in
check_method_definitionto detect abstract methods with private identifiers - Implemented validation in new
check_property_definitionfunction to detect abstract properties with private identifiers - Integrated
PropertyDefinitionchecking into the main semantic checker dispatch
Reviewed changes
Copilot reviewed 3 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crates/oxc_semantic/src/diagnostics.rs | Adds new diagnostic function for TS18019 error |
| crates/oxc_semantic/src/checker/typescript.rs | Implements checks for abstract modifier with private identifiers in both methods and properties |
| crates/oxc_semantic/src/checker/mod.rs | Integrates PropertyDefinition into the semantic checker dispatch |
| tasks/coverage/snapshots/semantic_babel.snap | Updates to show proper error reporting instead of scope mismatch |
| tasks/coverage/snapshots/parser_typescript.snap | Adds expected error output for TypeScript conformance test |
| tasks/coverage/snapshots/parser_babel.snap | Shows two previously failing tests now correctly report semantic errors |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d3c5c3f to
dfc4239
Compare
Merging this PR will not alter performance
Comparing Footnotes
|
Merge activity
|
dfc4239 to
329a648
Compare
…tifier (#18173) ## Summary - Add semantic check for TypeScript error 18019: "'abstract' modifier cannot be used with a private identifier" - This error is reported when a class member (method or property) has both the `abstract` modifier and a private identifier key (e.g., `abstract #foo`) Fixes 2 Babel conformance tests that expected this syntax error. ## Test plan - `cargo coverage -- parser` passes - Verified TypeScript reports TS18019 for these cases 🤖 Generated with [Claude Code](https://claude.com/claude-code)
329a648 to
1b199af
Compare
Summary
abstractmodifier and a private identifier key (e.g.,abstract #foo)Fixes 2 Babel conformance tests that expected this syntax error.
Test plan
cargo coverage -- parserpasses🤖 Generated with Claude Code