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(
5620
5620
// / generic requirement and if so return that type or null type otherwise.
5621
5621
Type getConcreteReplacementForProtocolSelfType (ValueDecl *member);
5622
5622
5623
+ // / Determine whether given disjunction constraint represents a set
5624
+ // / of operator overload choices.
5625
+ bool isOperatorDisjunction (Constraint *disjunction);
5626
+
5623
5627
} // end namespace constraints
5624
5628
5625
5629
template <typename ...Args>
Original file line number Diff line number Diff line change @@ -5689,3 +5689,18 @@ TypeVarBindingProducer::getDefaultBinding(Constraint *constraint) const {
5689
5689
? binding.withType (OptionalType::get (type))
5690
5690
: binding;
5691
5691
}
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