File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -5214,6 +5214,10 @@ class ConstraintSystem {
5214
5214
// / as the anchor, and a path to the argument at index `0`.
5215
5215
ConstraintLocator *getArgumentLocator (Expr *expr);
5216
5216
5217
+ // / Determine whether given locator represents an argument to declaration
5218
+ // / imported from C/ObjectiveC.
5219
+ bool isArgumentOfImportedDecl (ConstraintLocatorBuilder locator);
5220
+
5217
5221
SWIFT_DEBUG_DUMP;
5218
5222
SWIFT_DEBUG_DUMPER (dump(Expr *));
5219
5223
Original file line number Diff line number Diff line change @@ -4999,6 +4999,22 @@ bool constraints::isArgumentOfReferenceEqualityOperator(
4999
4999
isOperatorArgument (locator, " !==" );
5000
5000
}
5001
5001
5002
+ bool ConstraintSystem::isArgumentOfImportedDecl (
5003
+ ConstraintLocatorBuilder locator) {
5004
+ auto last = locator.last ();
5005
+ if (!(last && last->is <LocatorPathElt::ApplyArgToParam>()))
5006
+ return false ;
5007
+
5008
+ auto *application = getCalleeLocator (getConstraintLocator (locator));
5009
+
5010
+ auto overload = findSelectedOverloadFor (application);
5011
+ if (!(overload && overload->choice .isDecl ()))
5012
+ return false ;
5013
+
5014
+ auto *choice = overload->choice .getDecl ();
5015
+ return choice->hasClangNode ();
5016
+ }
5017
+
5002
5018
ConversionEphemeralness
5003
5019
ConstraintSystem::isConversionEphemeral (ConversionRestrictionKind conversion,
5004
5020
ConstraintLocatorBuilder locator) {
You can’t perform that action at this time.
0 commit comments