mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Sema] Fix issue 65330 Unhelpful error when missing contextually required as bridging conversion to AnyObject in structural position. Minor formatting change in previous test case
This commit is contained in:
@@ -1934,18 +1934,10 @@ bool AllowNonClassTypeToConvertToAnyObject::diagnose(const Solution &solution,
|
||||
bool asNote) const {
|
||||
auto *locator = getLocator();
|
||||
|
||||
if (locator->isForContextualType()) {
|
||||
ContextualFailure failure(solution, getFromType(), getToType(), locator);
|
||||
return failure.diagnose(asNote);
|
||||
}
|
||||
NonClassTypeToAnyObjectConversionFailure failure(solution, getFromType(),
|
||||
getToType(), locator);
|
||||
|
||||
if (locator->isLastElement<LocatorPathElt::ApplyArgToParam>()) {
|
||||
ArgumentMismatchFailure failure(solution, getFromType(), getToType(),
|
||||
locator);
|
||||
return failure.diagnose(asNote);
|
||||
}
|
||||
|
||||
return false;
|
||||
return failure.diagnose(asNote);
|
||||
}
|
||||
|
||||
AllowNonClassTypeToConvertToAnyObject *
|
||||
|
||||
Reference in New Issue
Block a user