-
Notifications
You must be signed in to change notification settings - Fork 13k
Error handling test #62219
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: main
Are you sure you want to change the base?
Error handling test #62219
Conversation
@johnfav03 please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
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 adds a new TypeScript compiler error that prevents comparison operations (except equality) between string literals. The change introduces validation to catch potentially problematic string literal comparisons during compilation.
Key changes:
- Adds a new error diagnostic for string literal comparisons
- Implements compiler logic to detect and report string literal comparison operations
- Creates test case to validate the new error behavior
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
tests/cases/compiler/StringComp.ts | Test case demonstrating string literal comparison that should trigger the new error |
tests/baselines/reference/stringComp.* | Baseline files for the new compiler test (types, symbols, and JS output) |
src/compiler/diagnosticMessages.json | New error message for string literal comparison restriction |
src/compiler/checker.ts | Compiler logic to detect and report string literal comparison errors |
Comments suppressed due to low confidence (2)
//// [tests/cases/compiler/stringComp.ts] //// | ||
|
||
=== stringComp.ts === | ||
|
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.
The baseline file references 'stringComp.ts' but the actual test file is named 'StringComp.ts', creating a mismatch that will cause test failures.
//// [tests/cases/compiler/stringComp.ts] //// | |
=== stringComp.ts === | |
//// [tests/cases/compiler/StringComp.ts] //// | |
=== stringComp.ts === |
Copilot uses AI. Check for mistakes.
//// [tests/cases/compiler/stringComp.ts] //// | ||
|
||
//// [stringComp.ts] | ||
|
||
|
||
//// [stringComp.js] |
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.
The baseline file references 'stringComp.ts' but the actual test file is named 'StringComp.ts', creating a mismatch that will cause test failures.
//// [tests/cases/compiler/stringComp.ts] //// | |
//// [stringComp.ts] | |
//// [stringComp.js] | |
//// [tests/cases/compiler/StringComp.ts] //// | |
//// [StringComp.ts] | |
//// [stringComp.js] |
Copilot uses AI. Check for mistakes.
Fixes #