mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[ConstraintSystem] Add a helper to determine whether locator is for argument to C/ObjC imported decl
This commit is contained in:
@@ -4999,6 +4999,22 @@ bool constraints::isArgumentOfReferenceEqualityOperator(
|
||||
isOperatorArgument(locator, "!==");
|
||||
}
|
||||
|
||||
bool ConstraintSystem::isArgumentOfImportedDecl(
|
||||
ConstraintLocatorBuilder locator) {
|
||||
auto last = locator.last();
|
||||
if (!(last && last->is<LocatorPathElt::ApplyArgToParam>()))
|
||||
return false;
|
||||
|
||||
auto *application = getCalleeLocator(getConstraintLocator(locator));
|
||||
|
||||
auto overload = findSelectedOverloadFor(application);
|
||||
if (!(overload && overload->choice.isDecl()))
|
||||
return false;
|
||||
|
||||
auto *choice = overload->choice.getDecl();
|
||||
return choice->hasClangNode();
|
||||
}
|
||||
|
||||
ConversionEphemeralness
|
||||
ConstraintSystem::isConversionEphemeral(ConversionRestrictionKind conversion,
|
||||
ConstraintLocatorBuilder locator) {
|
||||
|
||||
Reference in New Issue
Block a user