-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Error 2488 only shown once #46272
Comments
This is not something we’re interested in doing in general, but this particular example looks surprising to me and feels like probably a mistake. |
I would expect all errors to be shown when the compilation fails so I can fix all errors at once. |
This is a more significant issue than it first appears. If you ignore the first error with This feels like a clear bug to me. |
Everything bad we predicted from implementing |
Thanks for the response @RyanCavanaugh 🙏. Also without the We at StrykerJS rely on a full error report in order to validate multiple mutants at the same time in stryker-mutator/stryker-js#3900. |
Add grouping mutants to the `@stryker-mutator/typescript-checker` to improve performance. The typescript checker is slow because mutants are checked for compile errors one by one. Each time a mutant is checked, TypeScript will do full type-checking. This is sped up by running multiple checkers in parallel, using typescript's `--watch` mode, and only compiling in memory. Yet still, this is very slow, as a rule of thumb: 10x slower than not enabling this checker. This PR improves this by grouping mutants unrelated to each other in the same typescript compilation run. Any compilation errors that result from one of the mutants in a group can always be associated with one mutant. One downside to this approach is that a TypeScript compilation sometimes forgets to report some of the errors (although it is a design goal of TypeScript to report them all). For example microsoft/TypeScript#46272 This is why you disable this grouping behavior by adding: ```json { "typeScriptChecker": { "prioritizePerformanceOverAccuracy": false } } ```
Bug Report
When the error
Type '{type}[] | undefined' must have a '[Symbol.iterator]()' method that returns an iterator.(2488)
occurs multiple times in a project it only shows once.As could be seen in the image above only
data_1
has red underline, while I expect to also have red underline bydata_2
.🕗 Version & Regression Information
When using es5 or older both errors are shown, but from es6 only one error shows.
⏯ Playground Link
Playground link with example
💻 Code
🙁 Actual behavior
The TypeScript compiler is only returning one of the multiple errors when the error is of type 2488.
🙂 Expected behavior
The TypeScript compiler should return all the locations of the errors, even if they are the same type. This would be handy for code analysis tools.
The text was updated successfully, but these errors were encountered: