Files
swift-mirror/test/Concurrency/sendable_checking_swift6.swift
Holly Borla 1ec5808119 [Availability] Diagnose unavailable conformances in UnderlyingToOpaqueExpr.
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.
2024-05-16 21:14:06 -07:00

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}}
}