File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -1156,6 +1156,13 @@ static void performEndOfPipelineActions(CompilerInstance &Instance) {
11561156
11571157 // Emit extracted constant values for every file in the batch
11581158 emitConstValuesForAllPrimaryInputsIfNeeded (Instance);
1159+
1160+ // Make sure we emitted an error if we encountered an invalid conformance.
1161+ // This is important since `ASTContext::hadError` accounts for delayed
1162+ // conformance diags, so we need to ensure we don't exit with a non-zero exit
1163+ // code without emitting any error.
1164+ ASSERT (ctx.Diags .hadAnyError () || !ctx.hasDelayedConformanceErrors () &&
1165+ " Encountered invalid conformance without emitting error?" );
11591166}
11601167
11611168static bool printSwiftVersion (const CompilerInvocation &Invocation) {
Original file line number Diff line number Diff line change @@ -1496,8 +1496,15 @@ void ConstraintSystem::openGenericRequirement(
14961496 switch (kind) {
14971497 case RequirementKind::Conformance: {
14981498 auto protoDecl = req.getProtocolDecl ();
1499- // Determine whether this is the protocol 'Self' constraint we should
1500- // skip.
1499+ // Determine whether this is the protocol 'Self' constraint we should skip.
1500+ //
1501+ // NOTE: At first glance it seems like this is just an optimization to avoid
1502+ // adding a redundant constraint, but it is in fact load bearing for
1503+ // DistributedActor since we can form a conformance to Actor in
1504+ // GetDistributedActorAsActorConformanceRequest despite the fact that
1505+ // DistributedActor does not require Actor conformance (although conforming
1506+ // types are guaranteed to have the witnesses). So a conformance check in
1507+ // that case would fail.
15011508 if (skipProtocolSelfConstraint && protoDecl == outerDC &&
15021509 protoDecl->getSelfInterfaceType ()->isEqual (req.getFirstType ()))
15031510 return ;
You can’t perform that action at this time.
0 commit comments