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