mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This matches send non sendable but importantly also makes it clear that we are talking about something that doesn't conform to the Sendable protocol which is capitalized. rdar://151802975
23 lines
871 B
Swift
23 lines
871 B
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: %target-swift-frontend -emit-module -emit-module-path %t/StrictModule.swiftmodule -module-name StrictModule -swift-version 6 %S/Inputs/StrictModule.swift
|
|
// RUN: %target-swift-frontend -emit-module -emit-module-path %t/NonStrictModule.swiftmodule -module-name NonStrictModule %S/Inputs/NonStrictModule.swift
|
|
|
|
// RUN: %target-swift-frontend -I %t %s -emit-sil -o /dev/null -verify -strict-concurrency=complete
|
|
|
|
// REQUIRES: concurrency
|
|
// REQUIRES: asserts
|
|
|
|
@preconcurrency import NonStrictModule
|
|
@preconcurrency import StrictModule
|
|
|
|
@available(SwiftStdlib 5.1, *)
|
|
actor ActorWithDeinit {
|
|
var ns: NonStrictClass = NonStrictClass()
|
|
var ss: StrictStruct = StrictStruct()
|
|
|
|
deinit {
|
|
print(ns)
|
|
print(ss) // expected-warning{{cannot access property 'ss' with a non-Sendable type 'StrictStruct' from nonisolated deinit}}
|
|
}
|
|
}
|