Files
swift-mirror/test/Concurrency/sendable_witness_check_delayed.swift
Michael Gottesman 99e3f7fb13 [region-isolation] Make RegionBasedIsolation an upcoming feature for swift 6.
To make the tests pass, I had to teach sil-opt how to setup upcoming features
since it did not know how to parse them.

rdar://124100266
2024-03-05 15:15:14 -08:00

22 lines
847 B
Swift

// RUN: %target-swift-frontend -o /dev/null -emit-sil %s -verify
// RUN: %target-swift-frontend -o /dev/null -emit-sil %s -verify -strict-concurrency=targeted
// RUN: %target-swift-frontend -o /dev/null -emit-sil %s -verify -strict-concurrency=complete
// RUN: %target-swift-frontend -o /dev/null -emit-sil %s -verify -strict-concurrency=complete -enable-upcoming-feature RegionBasedIsolation
// REQUIRES: asserts
// This triggers a conformance check with SuppressDiagnostics=true.
let x = S().f {}
protocol P {
associatedtype A
func f(_: A) -> Int // expected-note {{expected sendability to match requirement here}}
}
struct S : P {
typealias A = () -> ()
func f(_: @Sendable () -> ()) -> Int { return 0 }
// expected-warning@-1 {{sendability of function types in instance method 'f' does not match requirement in protocol 'P'}}
}