mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #74564 from gottesmm/pr-9be87019f95149167c2e03043b7a86b82f9d282c
Follow up fixes with feedback from #74129
This commit is contained in:
@@ -7919,21 +7919,25 @@ bool NonEphemeralConversionFailure::diagnoseAsError() {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SendingOnFunctionParameterMismatchFail::diagnoseAsError() {
|
||||
emitDiagnosticAt(getLoc(), diag::sending_function_wrong_sending,
|
||||
getFromType(), getToType())
|
||||
bool SendingMismatchFailure::diagnoseAsError() {
|
||||
if (getLocator()->getLastElementAs<LocatorPathElt::FunctionArgument>())
|
||||
return diagnoseArgFailure();
|
||||
return diagnoseResultFailure();
|
||||
}
|
||||
|
||||
bool SendingMismatchFailure::diagnoseArgFailure() {
|
||||
emitDiagnostic(diag::sending_function_wrong_sending, getFromType(),
|
||||
getToType())
|
||||
.warnUntilSwiftVersion(6);
|
||||
emitDiagnosticAt(getLoc(),
|
||||
diag::sending_function_param_with_sending_param_note);
|
||||
emitDiagnostic(diag::sending_function_param_with_sending_param_note);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SendingOnFunctionResultMismatchFailure::diagnoseAsError() {
|
||||
emitDiagnosticAt(getLoc(), diag::sending_function_wrong_sending,
|
||||
getFromType(), getToType())
|
||||
bool SendingMismatchFailure::diagnoseResultFailure() {
|
||||
emitDiagnostic(diag::sending_function_wrong_sending, getFromType(),
|
||||
getToType())
|
||||
.warnUntilSwiftVersion(6);
|
||||
emitDiagnosticAt(getLoc(),
|
||||
diag::sending_function_result_with_sending_param_note);
|
||||
emitDiagnostic(diag::sending_function_result_with_sending_param_note);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user