Files
swift-mirror/test/Concurrency/predates_concurrency_import_deinit.swift
Michael Gottesman 3ed4059a60 [sema] Change non-sendable -> non-Sendable in diagnostics.
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
2025-05-22 11:37:58 -07:00

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