Files
swift-mirror/test/Concurrency/sendable_cycle.swift
Doug Gregor 94a2529609 Teach diagnostic about non-Sendable global lets to respect @preconcurrency
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.
2024-05-16 11:24:22 -07:00

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