File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -5620,6 +5620,10 @@ void performSyntacticDiagnosticsForTarget(
56205620// / generic requirement and if so return that type or null type otherwise.
56215621Type getConcreteReplacementForProtocolSelfType (ValueDecl *member);
56225622
5623+ // / Determine whether given disjunction constraint represents a set
5624+ // / of operator overload choices.
5625+ bool isOperatorDisjunction (Constraint *disjunction);
5626+
56235627} // end namespace constraints
56245628
56255629template <typename ...Args>
Original file line number Diff line number Diff line change @@ -5689,3 +5689,18 @@ TypeVarBindingProducer::getDefaultBinding(Constraint *constraint) const {
56895689 ? binding.withType (OptionalType::get (type))
56905690 : binding;
56915691}
5692+
5693+ bool constraints::isOperatorDisjunction (Constraint *disjunction) {
5694+ assert (disjunction->getKind () == ConstraintKind::Disjunction);
5695+
5696+ auto choices = disjunction->getNestedConstraints ();
5697+ if (choices.empty ())
5698+ return false ;
5699+
5700+ auto *choice = choices.front ();
5701+ if (choice->getKind () != ConstraintKind::BindOverload)
5702+ return false ;
5703+
5704+ auto *decl = choice->getOverloadChoice ().getDeclOrNull ();
5705+ return decl ? decl->isOperator () : false ;
5706+ }
You can’t perform that action at this time.
0 commit comments