mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
The diagnostic for non-Sendable globa/static `let` properties was checking for a Sendable conformance without considering `@preconcurrency`. Emit this diagnostic via a `@preconcurrency`-sensitive path. Fixes rdar://121889248.
16 lines
1.0 KiB
Swift
16 lines
1.0 KiB
Swift
// RUN: %target-swift-frontend %S/Inputs/sendable_cycle_other.swift -disable-availability-checking %s -verify -emit-sil -o /dev/null
|
|
// RUN: %target-swift-frontend %S/Inputs/sendable_cycle_other.swift -disable-availability-checking %s -verify -emit-sil -o /dev/null -strict-concurrency=targeted
|
|
// RUN: %target-swift-frontend %S/Inputs/sendable_cycle_other.swift -disable-availability-checking %s -verify -emit-sil -o /dev/null -strict-concurrency=complete -verify-additional-prefix complete-
|
|
// RUN: %target-swift-frontend %S/Inputs/sendable_cycle_other.swift -disable-availability-checking %s -verify -emit-sil -o /dev/null -strict-concurrency=complete -verify-additional-prefix complete- -enable-upcoming-feature RegionBasedIsolation
|
|
|
|
// REQUIRES: concurrency
|
|
// REQUIRES: asserts
|
|
|
|
struct Bar { // expected-note*{{consider making struct 'Bar' conform to the 'Sendable' protocol}}
|
|
lazy var foo = { // expected-error {{escaping closure captures mutating 'self' parameter}}
|
|
self.x() // expected-note {{captured here}}
|
|
}
|
|
|
|
func x() -> Int { 42 }
|
|
}
|