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.
This should fix issues with namespaces disappearing with in-memory cross-project references, which happened quite often with FCS solution when using live buffers (#14033).
The underlying issue was in incremental builder where it's assumed that computing the last bound model would evaluate all the other ones too, which is not necessarily the case, and then accessing them by
ValueOption.Value.For some reason the diagnostics for this didn't show. They are reported from here:
fsharp/src/Compiler/Driver/CompilerImports.fs
Lines 2221 to 2225 in fdba974
One suspected location which could produce an "unlinked" graph node is here:
fsharp/src/Compiler/Service/IncrementalBuild.fs
Line 1101 in fdba974
Even though we already have the result, the internal
cachedResultwill not be automatically populated andtryPeekValuewill returnNone. Will probably fix that in a separate PR.But this doesn't have to be (the only) reason for the issue, so better just avoid using
.Valuealtogether. Probably should get rid of this one as well:fsharp/src/Compiler/Service/IncrementalBuild.fs
Line 365 in fdba974