Merge pull request #67528 from tshortli/revert-66930

Sema: Resume diagnosing `@backDeployed` on functions with opaque result types as errors
This commit is contained in:
Allan Shortlidge
2023-07-26 09:15:50 -07:00
committed by GitHub
2 changed files with 3 additions and 3 deletions

View File

@@ -7077,7 +7077,7 @@ ERROR(attr_incompatible_with_back_deploy,none,
"'%0' cannot be applied to a back deployed %1",
(DeclAttribute, DescriptiveDeclKind))
WARNING(backdeployed_opaque_result_not_supported,none,
ERROR(backdeployed_opaque_result_not_supported,none,
"'%0' is unsupported on a %1 with a 'some' return type",
(DeclAttribute, DescriptiveDeclKind))

View File

@@ -266,13 +266,13 @@ public struct ConformsToTopLevelProtocol: TopLevelProtocol {
}
@available(SwiftStdlib 5.1, *)
@backDeployed(before: macOS 12.0) // expected-warning {{'@backDeployed' is unsupported on a var with a 'some' return type}}
@backDeployed(before: macOS 12.0) // expected-error {{'@backDeployed' is unsupported on a var with a 'some' return type}}
public var cannotBackDeployVarWithOpaqueResultType: some TopLevelProtocol {
return ConformsToTopLevelProtocol()
}
@available(SwiftStdlib 5.1, *)
@backDeployed(before: macOS 12.0) // expected-warning {{'@backDeployed' is unsupported on a global function with a 'some' return type}}
@backDeployed(before: macOS 12.0) // expected-error {{'@backDeployed' is unsupported on a global function with a 'some' return type}}
public func cannotBackDeployFuncWithOpaqueResultType() -> some TopLevelProtocol {
return ConformsToTopLevelProtocol()
}