mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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.
17 lines
523 B
Swift
17 lines
523 B
Swift
// 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}}
|
|
}
|