forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Availability] Diagnose unavailable conformances in UnderlyingToOpaqu…
…eExpr. Change the availability checker to check substitution maps of underlying values for opaque result types to diagnose unavailable conformances. This change also makes sure `Sendable` availability diagnostics are errors in Swift 6 mode.
- Loading branch information
Showing
4 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// RUN: %target-swift-frontend -emit-sil -swift-version 6 %s -o /dev/null -verify | ||
|
||
// REQUIRES: concurrency | ||
|
||
|
||
struct UnavailableSendable {} | ||
|
||
@available(*, unavailable) | ||
extension UnavailableSendable: Sendable {} | ||
// expected-note@-1 {{conformance of 'UnavailableSendable' to 'Sendable' has been explicitly marked unavailable here}} | ||
|
||
@available(SwiftStdlib 5.1, *) | ||
func checkOpaqueType() -> some Sendable { | ||
UnavailableSendable() | ||
// expected-error@-1 {{conformance of 'UnavailableSendable' to 'Sendable' is unavailable}} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters