Files
swift-mirror/test/ModuleInterface/coroutine_accessors.swift
Becca Royal-Gordon 1f008fb0d0 [ModuleInterface] Enable module selectors by default
And update tests to use them.

This commit depends on fixes in swiftlang/swift PRs #86905, #87129, and #87130.

Fixes rdar://169749886.
2026-02-20 00:35:23 -08:00

32 lines
811 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
}
}