ParseAndCheckProject no longers reports all diagnostics #15337
Closed
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.
Hi all,
This is more of a question and potentially a bug report disguised as a PR.
I believe I found a regression when it comes to the compiler diagnostics of implementation files that were backed by a signature file.
See MissingDiagnostic.fs for a concrete example.
The diagnostic reported in the implementation file is not covered anymore by
FSharpChecker.ParseAndCheckProject
.I suspect this is happens in
FinalizeTypeCheckTask
becausefsharp/src/Compiler/Service/IncrementalBuild.fs
Lines 720 to 723 in ebd758e
will contain the same diagnostics that were reported in the signature file for both files.
The implementation file will wrap the signature diagnostics in
fsharp/src/Compiler/Service/IncrementalBuild.fs
Lines 305 to 321 in ebd758e
tcDiagnosticsRev = prevTcInfo.tcDiagnosticsRev
being the culprit.Later in
FinalizeTypeCheckTask
let finalInfo = Array.last tcInfos
andlet diagnostics = diagnosticsLogger.GetDiagnostics() :: finalInfo.tcDiagnosticsRev
will the wrong diagnostics.This is breaking behaviour if you compare it against
FCS 43.7.200
.See MissingDiagnostic.zip sample to compare them.
Note that changing
FSharpChecker.Create(enablePartialTypeChecking = enablePartialTypeChecking)
doesn't seem to have any effect on this.The changes in #14903 might be related or relevant here.
@majocha would you mind taking a look at this?