From be2d4d8ffd7b7e4b53fda4d9834c5ad65822b2c4 Mon Sep 17 00:00:00 2001 From: Allan Shortlidge Date: Fri, 11 Aug 2023 09:38:38 -0700 Subject: [PATCH] Revert "Revert "Sema: temporarily downgrade backdeployed_opaque_result_not_supported to a warning"" This reverts commit e3453ca32af7cd4475bad7566f2c274eb07ca276. --- include/swift/AST/DiagnosticsSema.def | 2 +- test/attr/attr_backDeployed.swift | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/swift/AST/DiagnosticsSema.def b/include/swift/AST/DiagnosticsSema.def index 97106963c3283..122541fa54032 100644 --- a/include/swift/AST/DiagnosticsSema.def +++ b/include/swift/AST/DiagnosticsSema.def @@ -7082,7 +7082,7 @@ ERROR(attr_incompatible_with_back_deploy,none, "'%0' cannot be applied to a back deployed %1", (DeclAttribute, DescriptiveDeclKind)) -ERROR(backdeployed_opaque_result_not_supported,none, +WARNING(backdeployed_opaque_result_not_supported,none, "'%0' is unsupported on a %1 with a 'some' return type", (DeclAttribute, DescriptiveDeclKind)) diff --git a/test/attr/attr_backDeployed.swift b/test/attr/attr_backDeployed.swift index c7d4d3e0bbf31..252c68dad8755 100644 --- a/test/attr/attr_backDeployed.swift +++ b/test/attr/attr_backDeployed.swift @@ -266,13 +266,13 @@ public struct ConformsToTopLevelProtocol: TopLevelProtocol { } @available(SwiftStdlib 5.1, *) -@backDeployed(before: macOS 12.0) // expected-error {{'@backDeployed' is unsupported on a var with a 'some' return type}} +@backDeployed(before: macOS 12.0) // expected-warning {{'@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-error {{'@backDeployed' is unsupported on a global function with a 'some' return type}} +@backDeployed(before: macOS 12.0) // expected-warning {{'@backDeployed' is unsupported on a global function with a 'some' return type}} public func cannotBackDeployFuncWithOpaqueResultType() -> some TopLevelProtocol { return ConformsToTopLevelProtocol() }