mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Frontend] Enforce an error was emitted for invalid conformance
Make sure we emitted an error if we encountered an invalid conformance error. This is important since `ASTContext::hadError` accounts for such delayed errors, so we need to make sure we don't ever exit with a non-zero exit code without emitting any error.
This commit is contained in:
@@ -1120,6 +1120,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) {
|
||||
|
||||
Reference in New Issue
Block a user