Implement pre-emit/post-emit diagnostic count mismatch detection (TS-1)#3738
Draft
Implement pre-emit/post-emit diagnostic count mismatch detection (TS-1)#3738
Conversation
Uncomment and implement the pre-emit/post-emit diagnostic comparison in the test harness. This creates a separate pre-program to collect diagnostics before emit, then compares with post-emit diagnostics from the main program. When counts differ, a TS-1 internal diagnostic is emitted with details about the excess diagnostics. Also adds diagnostics.NewMessage() to create custom Message objects for the TS-1 diagnostics, and resets the tracer between pre and main programs to avoid trace pollution. Agent-Logs-Url: https://github.com/microsoft/typescript-go/sessions/1afca828-e811-4d01-9523-d815fcf522d1 Co-authored-by: gabritto <19519347+gabritto@users.noreply.github.com>
jakebailey
reviewed
May 7, 2026
Member
|
I think this is technically a dupe of #1301 but it's been a while so I think we don't need some of the fixes in that PR? |
…arison Use a single program to collect diagnostics before and after emit, comparing counts excluding declaration diagnostics to avoid GetDeclarationDiagnostics side-effect pollution. When counts differ, use the shorter diagnostic list as the base result (matching TS behavior). Agent-Logs-Url: https://github.com/microsoft/typescript-go/sessions/1afca828-e811-4d01-9523-d815fcf522d1 Co-authored-by: gabritto <19519347+gabritto@users.noreply.github.com>
Only keep baseline changes for the three target tests specified in the issue. Remove all other baseline changes that were accidentally included from a full test run baseline-accept. Agent-Logs-Url: https://github.com/microsoft/typescript-go/sessions/1afca828-e811-4d01-9523-d815fcf522d1 Co-authored-by: gabritto <19519347+gabritto@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix Corsa diagnostics for pre-emit and post-emit mismatches
Implement pre-emit/post-emit diagnostic count mismatch detection (TS-1)
May 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The test harness was missing the TS-1 internal diagnostic that detects when emit causes the checker to discover new semantic errors via the emit resolver. This was stubbed out with comments referencing the TypeScript implementation but never ported.
Changes
internal/diagnostics/diagnostics.go— AddNewMessage()constructor for creatingMessageobjects with arbitrary code/category/text, needed for the synthetic TS-1 diagnosticsinternal/testutil/harnessutil/harnessutil.go— Replace commented-out comparison logic with working implementation:GetDeclarationDiagnosticstriggering the emit resolver as a side effect (Go shares checker state within a single program, unlike TS which uses two independent programs)skipLibCheck && declarationare both set.difffiles are removed (output now matches TypeScript reference), and their entries are removed fromsubmoduleTriaged.txtExample output