Phase ordering issue in C# compiler with declaration diagnostics. #846
Labels
Area-Compilers
Bug
Concept-Design Debt
Engineering Debt, Design Debt, or poor product code quality
Language-C#
Milestone
The field
CSharpCompilation.SemanticDiagnostics
is actually used to gather declaration diagnostics. Therefore no additional diagnostics should be placed into it once we are done with that phase. We had no code to check that invariant in the compiler. In practice what that means is that any diagnostics that are placed into this bag "too late" are simply dropped on the floor and not reported.This should be fixed. It should not be possible to add diagnostics to that bag after we are done processing declarations.
I am changing the name of that to
CSharpCompilation.DeclarationDiagnostics
for clarity. I tried adding an assert to enforce the property that we do not add diagnostics too late, but that assert failed in a number of places (all of which are latent bugs). I am commenting out that assert for now, but we should track down and fix all of the latent bugs, and then reenable the assertion. The (disabled) assertion is the first line ofCSharpCompilation.DeclarationDiagnostics.get
The text was updated successfully, but these errors were encountered: