Merge pull request #85738 from hamishknight/to-wit

[Frontend] Enforce an error was emitted for invalid conformance
This commit is contained in:
Hamish Knight
2025-12-10 14:00:14 +00:00
committed by GitHub
2 changed files with 16 additions and 2 deletions

View File

@@ -1156,6 +1156,13 @@ static void performEndOfPipelineActions(CompilerInstance &Instance) {
// Emit extracted constant values for every file in the batch
emitConstValuesForAllPrimaryInputsIfNeeded(Instance);
// Make sure we emitted an error if we encountered an invalid conformance.
// This is important since `ASTContext::hadError` accounts for delayed
// conformance diags, so we need to ensure we don't exit with a non-zero exit
// code without emitting any error.
ASSERT(ctx.Diags.hadAnyError() || !ctx.hasDelayedConformanceErrors() &&
"Encountered invalid conformance without emitting error?");
}
static bool printSwiftVersion(const CompilerInvocation &Invocation) {