@@ -1123,21 +1123,21 @@ operator()(CanType maybeOpaqueType, Type replacementType,
1123
1123
ProtocolDecl *protocol) const {
1124
1124
auto archetype = dyn_cast<OpaqueTypeArchetypeType>(maybeOpaqueType);
1125
1125
if (!archetype)
1126
- return lookupConformance (replacementType , protocol);
1126
+ return ProtocolConformanceRef::forAbstract (maybeOpaqueType , protocol);
1127
1127
1128
1128
auto *genericEnv = archetype->getGenericEnvironment ();
1129
1129
auto *decl = genericEnv->getOpaqueTypeDecl ();
1130
1130
auto outerSubs = genericEnv->getOuterSubstitutions ();
1131
1131
1132
1132
auto substitutionKind = shouldPerformSubstitution (decl);
1133
1133
if (substitutionKind == OpaqueSubstitutionKind::DontSubstitute)
1134
- return lookupConformance (replacementType, protocol);
1134
+ return ProtocolConformanceRef::forAbstract (replacementType, protocol);
1135
1135
1136
1136
auto subs = decl->getUniqueUnderlyingTypeSubstitutions ();
1137
1137
// If the body of the opaque decl providing decl has not been type checked we
1138
1138
// don't have a underlying substitution.
1139
1139
if (!subs.has_value ())
1140
- return lookupConformance (replacementType, protocol);
1140
+ return ProtocolConformanceRef::forAbstract (replacementType, protocol);
1141
1141
1142
1142
// Apply the underlying type substitutions to the interface type of the
1143
1143
// archetype in question. This will map the inner generic signature of the
@@ -1158,21 +1158,15 @@ operator()(CanType maybeOpaqueType, Type replacementType,
1158
1158
return true ;
1159
1159
return false ;
1160
1160
}))
1161
- return lookupConformance (replacementType, protocol);
1162
-
1163
- // Then apply the substitutions from the root opaque archetype, to specialize
1164
- // for its type arguments. We perform this substitution after checking for
1165
- // visibility, since we do not want the result of the visibility check to
1166
- // depend on the substitutions previously applied.
1167
- auto substTy = partialSubstTy.subst (outerSubs);
1161
+ return ProtocolConformanceRef::forAbstract (replacementType, protocol);
1168
1162
1169
1163
auto partialSubstRef =
1170
1164
subs->lookupConformance (archetype->getInterfaceType ()->getCanonicalType (),
1171
1165
protocol);
1172
1166
auto substRef = partialSubstRef.subst (outerSubs);
1173
1167
1174
1168
// If the type still contains opaque types, recur.
1175
- if (substTy ->hasOpaqueArchetype ()) {
1169
+ if (substRef. getType () ->hasOpaqueArchetype ()) {
1176
1170
SeenDecl seenKey (decl, outerSubs);
1177
1171
1178
1172
if (auto *alreadySeen = this ->seenDecls ) {
0 commit comments