Skip to content

Commit 29d8733

Browse files
committed
fix(ci): mark PowerCard.otherWatts nonisolated so tests compile under Swift 6
SwiftUI View is @MainActor-isolated under Swift 6 (Xcode 16.4 on CI), so the static otherWatts(...) inherited MainActor isolation and could not be called from the nonisolated XCTest methods in PowerMonitorTests — failing the Test job with exit code 65. The function is pure arithmetic; nonisolated is correct and matches PowerMonitor.appendCapped.
1 parent ee7704e commit 29d8733

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Mystral/Views/DashboardView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ struct PowerCard: View {
456456
/// Power not attributable to CPU/GPU (RAM, display, SSD, etc.). Clamped at 0:
457457
/// total (SMC) and CPU/GPU (IOReport) come from different sources sampled a beat
458458
/// apart and can momentarily disagree.
459-
static func otherWatts(total: Double, cpu: Double?, gpu: Double?) -> Double {
459+
nonisolated static func otherWatts(total: Double, cpu: Double?, gpu: Double?) -> Double {
460460
Swift.max(0, total - (cpu ?? 0) - (gpu ?? 0))
461461
}
462462
}

0 commit comments

Comments
 (0)