Merge pull request #66673 from tshortli/diagnose-back-deployed-opaque-result-types

Sema: Diagnose `@backDeployed` on functions with opaque result types
This commit is contained in:
Allan Shortlidge
2023-06-15 21:56:14 -07:00
committed by GitHub
5 changed files with 46 additions and 0 deletions

View File

@@ -564,6 +564,15 @@ namespace swift {
/// until the next major language version.
InFlightDiagnostic &warnUntilSwiftVersion(unsigned majorVersion);
/// Limit the diagnostic behavior to warning if the context is a
/// swiftinterface.
///
/// This is useful for diagnostics for restrictions that may be lifted by a
/// future version of the compiler. In such cases, it may be helpful to
/// avoid failing to build a module from its interface if the interface was
/// emitted using a compiler that no longer has the restriction.
InFlightDiagnostic &warnInSwiftInterface(const DeclContext *context);
/// Conditionally limit the diagnostic behavior to warning until
/// the specified version. If the condition is false, no limit is
/// imposed, meaning (presumably) it is treated as an error.

View File

@@ -7053,6 +7053,10 @@ 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,
"'%0' is unsupported on a %1 with a 'some' return type",
(DeclAttribute, DescriptiveDeclKind))
//------------------------------------------------------------------------------
// MARK: Implicit opening of existential types
//------------------------------------------------------------------------------