mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
When the feature is enabled, a read2 accessor is generated when a mutating getter is declared. rdar://149385088
25 lines
514 B
Swift
25 lines
514 B
Swift
// RUN: %target-typecheck-verify-swift \
|
|
// RUN: -enable-experimental-feature LifetimeDependence \
|
|
// RUN: -enable-experimental-feature CoroutineAccessors
|
|
|
|
// REQUIRES: swift_feature_LifetimeDependence
|
|
// REQUIRES: swift_feature_CoroutineAccessors
|
|
|
|
struct NE<T : ~Copyable & ~Escapable> : ~Copyable & ~Escapable {
|
|
@lifetime(&t)
|
|
init(
|
|
t: inout T
|
|
)
|
|
{
|
|
}
|
|
}
|
|
|
|
struct S : ~Copyable & ~Escapable {
|
|
var mutableBytes: NE<S> {
|
|
@lifetime(&self)
|
|
mutating get {
|
|
return NE(t: &self)
|
|
}
|
|
}
|
|
}
|