Skip to content
This repository was archived by the owner on Feb 2, 2025. It is now read-only.

Commit d15c034

Browse files
authored
Merge pull request #37 from YuAo/master
Make SwiftCoroutine compatible with `async/await` in Swift 5.5
2 parents 9c395df + 7235e38 commit d15c034

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

Sources/SwiftCoroutine/CoFuture/Core/CoFuture.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// Copyright © 2020 Alex Belozierov. All rights reserved.
77
//
88

9-
private protocol _CoFutureCancellable: class {
9+
private protocol _CoFutureCancellable: AnyObject {
1010

1111
func cancel()
1212

Sources/SwiftCoroutine/CoScope/CoCancellable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// Copyright © 2020 Alex Belozierov. All rights reserved.
77
//
88

9-
public protocol CoCancellable: class {
9+
public protocol CoCancellable: AnyObject {
1010

1111
/// Cancels the current `CoCancellable`.
1212
func cancel()

Sources/SwiftCoroutine/Coroutine/Coroutine/Coroutine.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public struct Coroutine {
122122
timer.schedule(deadline: .now() + time)
123123
defer { timer.cancel() }
124124
do {
125-
try await {
125+
try self.await {
126126
timer.setEventHandler(handler: $0)
127127
timer.start()
128128
}

Sources/SwiftCoroutine/Coroutine/CoroutineProtocol/CoroutineProtocol.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import Glibc
1212
import Darwin
1313
#endif
1414

15-
@usableFromInline internal protocol CoroutineProtocol: class {
15+
@usableFromInline internal protocol CoroutineProtocol: AnyObject {
1616

1717
typealias StackSize = Coroutine.StackSize
1818

0 commit comments

Comments
 (0)