Files
swift-mirror/test/SIL/Parser/basic2_noncopyable_generics.sil
T
Andrew Trick 8847c38bf2 [NFC] Update tests for conditionally ~Escapable dependencies
These changes are not required for the tests to pass but the tests now properly
express the original intention, which was to test conditionally Escapable types.
2026-02-14 17:35:23 -08:00

39 lines
1.1 KiB
Plaintext

// RUN: %target-sil-opt \
// RUN: %s \
// RUN: -enable-experimental-feature Lifetimes \
// RUN: | \
// RUN: %target-sil-opt \
// RUN: -enable-experimental-feature Lifetimes \
// RUN: | \
// RUN: %FileCheck %s
// REQUIRES: swift_feature_Lifetimes
// For -enable-experimental-feature Lifetimes
// TODO: Once NoncopyableGenerics/NonescapableTypes is no longer behind a feature flag, merge this into basic2.
sil_stage raw
import Swift
// CHECK-LABEL: struct NCG<T> : ~Copyable {
// CHECK-NEXT: var t: T
// CHECK-NEXT: deinit
struct NCG<T> : ~Copyable {
var t: T
deinit
}
// CHECK-LABEL: struct NEG<T> : ~Escapable where T : ~Escapable {
// CHECK-NEXT: var t: T
struct NEG<T : ~Escapable> : ~Escapable {
var t: T
@_lifetime(copy t)
init(_ t: consuming T) {
self.t = t
}
}
extension NEG: Escapable where T: Escapable {}