mirror of
https://github.com/apple/swift.git
synced 2026-03-04 18:24:35 +01:00
This does not rename all the internal variables, functions, and types whose names were based on the old syntax. I think it adds new syntax support everywhere it's needed while retaining enough of the old syntax support that early adopters will see nice deprecation messages guiding them to the new syntax.
32 lines
809 B
Swift
32 lines
809 B
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: %target-swift-emit-module-interface(%t.swiftinterface) \
|
|
// RUN: %s \
|
|
// RUN: -enable-experimental-feature CoroutineAccessors \
|
|
// RUN: -module-name Rock
|
|
// RUN: %FileCheck %s < %t.swiftinterface
|
|
// RUN: %target-swift-typecheck-module-from-interface(%t.swiftinterface) -module-name Rock
|
|
|
|
// REQUIRES: swift_feature_CoroutineAccessors
|
|
|
|
var _i: Int = 0
|
|
|
|
// CHECK: #if compiler(>=5.3) && $CoroutineAccessors
|
|
// CHECK-NEXT: public var i: Swift.Int {
|
|
// CHECK-NEXT: read
|
|
// CHECK-NEXT: modify
|
|
// CHECK-NEXT: }
|
|
// CHECK-NEXT: #else
|
|
// CHECK-NEXT: public var i: Swift.Int {
|
|
// CHECK-NEXT: _read
|
|
// CHECK-NEXT: _modify
|
|
// CHECK-NEXT: }
|
|
// CHECK-NEXT: #endif
|
|
public var i: Int {
|
|
yielding borrow {
|
|
yield _i
|
|
}
|
|
yielding mutate {
|
|
yield &_i
|
|
}
|
|
}
|