Skip to content

Commit fa5f3c5

Browse files
authored
Merge pull request #9 from lyrise/work-around-a-swift-compiler-bug
Workaround Compiler Bug in CI
2 parents 253aef8 + 3c76539 commit fa5f3c5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Sources/Socket/SocketManager/AsyncSocketManager.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,12 @@ private extension AsyncSocketManager {
211211
else { return }
212212
log("Will start monitoring")
213213
state.isMonitoring = true
214+
214215
// Create top level task to monitor
215-
Task.detached(priority: state.configuration.monitorPriority) { [unowned self] in
216-
await self.run()
216+
// MEMO: Using [weak self] instead of [unowned self] to work around a compiler bug.
217+
// This issue only occurs in CI environments, where using [unowned self] causes a compiler crash under certain conditions.
218+
Task.detached(priority: state.configuration.monitorPriority) { [weak self] in
219+
await self?.run()
217220
}
218221
}
219222

0 commit comments

Comments
 (0)