@@ -171,7 +171,7 @@ static void determineBestChoicesInContext(
171
171
172
172
// Match arguments to the given overload choice.
173
173
auto matchArguments = [&](OverloadChoice choice, FunctionType *overloadType)
174
- -> llvm::Optional <MatchCallArgumentResult> {
174
+ -> std::optional <MatchCallArgumentResult> {
175
175
auto *decl = choice.getDeclOrNull ();
176
176
assert (decl);
177
177
@@ -186,7 +186,7 @@ static void determineBestChoicesInContext(
186
186
return matchCallArguments (argsWithLabels, overloadType->getParams (),
187
187
paramListInfo,
188
188
argumentList->getFirstTrailingClosureIndex (),
189
- /* allow fixes*/ false , listener, llvm::None );
189
+ /* allow fixes*/ false , listener, std::nullopt );
190
190
};
191
191
192
192
// Determine whether the candidate type is a subclass of the superclass
@@ -209,15 +209,14 @@ static void determineBestChoicesInContext(
209
209
return false ;
210
210
211
211
return llvm::all_of (layout.getProtocols (), [&](ProtocolDecl *P) {
212
- if (auto superclass = P->getSuperclass ()) {
213
- if (!isSubclassOf (candidateType, superclass))
212
+ if (auto superclass = P->getSuperclassDecl ()) {
213
+ if (!isSubclassOf (candidateType,
214
+ superclass->getDeclaredInterfaceType ()))
214
215
return false ;
215
216
}
216
217
217
- return bool (TypeChecker::containsProtocol (
218
- candidateType, P, cs.DC ->getParentModule (),
219
- /* skipConditionalRequirements=*/ true ,
220
- /* allowMissing=*/ false ));
218
+ return bool (TypeChecker::containsProtocol (candidateType, P,
219
+ /* allowMissing=*/ false ));
221
220
});
222
221
}
223
222
@@ -639,13 +638,13 @@ selectBestBindingDisjunction(ConstraintSystem &cs,
639
638
return firstBindDisjunction;
640
639
}
641
640
642
- llvm::Optional <std::pair<Constraint *, llvm::TinyPtrVector<Constraint *>>>
641
+ std::optional <std::pair<Constraint *, llvm::TinyPtrVector<Constraint *>>>
643
642
ConstraintSystem::selectDisjunction () {
644
643
SmallVector<Constraint *, 4 > disjunctions;
645
644
646
645
collectDisjunctions (disjunctions);
647
646
if (disjunctions.empty ())
648
- return llvm::None ;
647
+ return std::nullopt ;
649
648
650
649
if (auto *disjunction = selectBestBindingDisjunction (*this , disjunctions))
651
650
return std::make_pair (disjunction, llvm::TinyPtrVector<Constraint *>());
@@ -683,5 +682,5 @@ ConstraintSystem::selectDisjunction() {
683
682
if (bestDisjunction != disjunctions.end ())
684
683
return std::make_pair (*bestDisjunction, favorings[*bestDisjunction]);
685
684
686
- return llvm::None ;
685
+ return std::nullopt ;
687
686
}
0 commit comments