From ea6a3da78b943d35b4b937e7f03e3e530bec1e65 Mon Sep 17 00:00:00 2001 From: "Developer @ Loverde Company" Date: Fri, 11 Sep 2026 11:02:02 -0300 Subject: [PATCH] fix(uitests): replace illegal key path with a closure in quickDiagnostics '.map(\.label)' failed to build: XCUIElement.label is @MainActor-isolated, and a bare key path literal must be formable from any isolation context, which a main-actor-isolated property can't satisfy. This was a hard compiler error (not just a concurrency warning), and it cascaded into a flood of secondary diagnostics across the whole file/batch compile unit, obscuring the actual cause. Replaced with a closure ('{ $0.label }'), which isn't subject to that restriction. --- PediFoodsUITests/CartCheckoutFlowTests.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PediFoodsUITests/CartCheckoutFlowTests.swift b/PediFoodsUITests/CartCheckoutFlowTests.swift index b25a156..9028e6d 100644 --- a/PediFoodsUITests/CartCheckoutFlowTests.swift +++ b/PediFoodsUITests/CartCheckoutFlowTests.swift @@ -39,9 +39,12 @@ final class CartCheckoutFlowTests: XCTestCase { if errorText.exists { signals.append("error text visible: \(errorText.label)") } + // A bare `\.label` key path literal is illegal here - `label` is + // @MainActor-isolated, and a key path must be formable from any + // isolation context. A closure isn't subject to that restriction. let visibleTexts = app.staticTexts.allElementsBoundByIndex .prefix(15) - .map(\.label) + .map { $0.label } .joined(separator: " | ") signals.append("visible static texts: [\(visibleTexts)]") return signals.joined(separator: "; ")