Make frozen doc state non-nullable#77896
Make frozen doc state non-nullable#77896CyrusNajmabadi merged 6 commits intodotnet:release/dev17.15from
Conversation
|
Trying something out to see if it cleans up compilation tracker state management. |
|
@dibarbet ptal. |
| Contract.ThrowIfFalse(FrozenSourceGeneratedDocumentIdentities.HasValue); | ||
| Contract.ThrowIfFalse(FrozenSourceGeneratedDocuments.HasValue); |
There was a problem hiding this comment.
If these should now always have a value, should they become non-nullable too?
There was a problem hiding this comment.
So much simpler. Thanks!
davidwengier
left a comment
There was a problem hiding this comment.
The changes from something being nullable to non-nullable make sense to me. Whether the scenario still makes sense I leave for someone else to work out :)
| ImmutableSegmentedDictionary<ProjectId, ICompilationTracker>? projectIdToTrackerMap = null, | ||
| SourceGeneratorExecutionVersionMap? sourceGeneratorExecutionVersionMap = null, | ||
| Optional<TextDocumentStates<SourceGeneratedDocumentState>?> frozenSourceGeneratedDocumentStates = default, | ||
| Optional<TextDocumentStates<SourceGeneratedDocumentState>> frozenSourceGeneratedDocumentStates = default, |
There was a problem hiding this comment.
You don't need Optional here anymore.
There was a problem hiding this comment.
Good call. Simplifying.
| // For the frozen source generated document info, we expect two either have both checksum collections or neither, and they | ||
| // should both be the same length as there is a 1:1 correspondence between them. | ||
| Contract.ThrowIfFalse(frozenSourceGeneratedDocumentIdentities.HasValue == frozenSourceGeneratedDocuments.HasValue); | ||
| Contract.ThrowIfFalse(frozenSourceGeneratedDocumentIdentities?.Count == frozenSourceGeneratedDocuments?.Length); |
There was a problem hiding this comment.
Did you still want to keep this assertion that the lengths match?
There was a problem hiding this comment.
will add back.
No description provided.