mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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:
@@ -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))
|
||||
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user