Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private InProgressState(
Compilation compilationWithoutGeneratedDocuments,
CompilationTrackerGeneratorInfo generatorInfo,
Compilation? staleCompilationWithGeneratedDocuments,
ImmutableList<(ProjectState state, CompilationAndGeneratorDriverTranslationAction action)> pendingTranslationSteps)
ImmutableList<(ProjectState oldState, CompilationAndGeneratorDriverTranslationAction action)> pendingTranslationSteps)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

naming for consistency.

: base(isFrozen,
compilationWithoutGeneratedDocuments,
generatorInfo)
Expand All @@ -108,7 +108,7 @@ public static InProgressState Create(
Compilation compilationWithoutGeneratedDocuments,
CompilationTrackerGeneratorInfo generatorInfo,
Compilation? staleCompilationWithGeneratedDocuments,
ImmutableList<(ProjectState state, CompilationAndGeneratorDriverTranslationAction action)> pendingTranslationSteps)
ImmutableList<(ProjectState oldState, CompilationAndGeneratorDriverTranslationAction action)> pendingTranslationSteps)
{
Contract.ThrowIfTrue(pendingTranslationSteps is null);

Expand Down Expand Up @@ -166,7 +166,10 @@ private FinalCompilationTrackerState(
: base(isFrozen, compilationWithoutGeneratedDocuments, generatorInfo)
{
Contract.ThrowIfNull(finalCompilationWithGeneratedDocuments);
HasSuccessfullyLoaded = hasSuccessfullyLoaded;

// As a policy, all partial-state projects are said to have incomplete references, since the
// state has no guarantees.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved from a different location here, so that we're consistent on what this bit means wrt frozen states.

HasSuccessfullyLoaded = hasSuccessfullyLoaded && !isFrozen;
FinalCompilationWithGeneratedDocuments = finalCompilationWithGeneratedDocuments;
UnrootedSymbolSet = unrootedSymbolSet;

Expand Down Expand Up @@ -205,6 +208,14 @@ public static FinalCompilationTrackerState Create(
unrootedSymbolSet);
}

public FinalCompilationTrackerState WithIsFrozen()
=> new(isFrozen: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new

no check to return this if already frozen?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair. i can do that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put into: #72111

FinalCompilationWithGeneratedDocuments,
CompilationWithoutGeneratedDocuments,
HasSuccessfullyLoaded,
GeneratorInfo,
UnrootedSymbolSet);

private static void RecordAssemblySymbols(ProjectId projectId, Compilation compilation, Dictionary<MetadataReference, ProjectId>? metadataReferenceToProjectId)
{
RecordSourceOfAssemblySymbol(compilation.Assembly, projectId);
Expand Down
Loading