Skip to content

Commit 3efb516

Browse files
fix: correct UniTask.WhenAny return type handling in UwbWebView
Windows build was failing with: error CS0019: Operator '==' cannot be applied to operands of type 'bool' and 'int' ROOT CAUSE: UniTask.WhenAny has different return types depending on input types: - WhenAny(UniTask<T>, UniTask<U>) returns (int, T/U) tuple - WhenAny(UniTask<T>, UniTask) returns int index directly Our case: WhenAny(UniTask<bool>, UniTask.Delay(...)) - UniTask.Delay returns UniTask (void), not UniTask<T> - So WhenAny returns int, not tuple FIX: Changed from: var (winIndex, _) = await UniTask.WhenAny(...) Changed to: int winIndex = await UniTask.WhenAny(...)
1 parent 23e89cf commit 3efb516

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/Packages/Passport/Runtime/Scripts/Private/Uwb/UwbWebView.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ private async UniTask WaitForClientConnected(WebBrowserClient webBrowserClient)
138138
Debug.Log($"[UwbWebView] Waiting up to {timeoutSeconds} seconds for OnLoadFinish event...");
139139

140140
// Race between completion and timeout
141-
var (winIndex, _) = await UniTask.WhenAny(completionTask, timeoutTask);
141+
// WhenAny with UniTask<T> and UniTask (void) returns int index directly
142+
int winIndex = await UniTask.WhenAny(completionTask, timeoutTask);
142143

143144
if (winIndex == 1) // Timeout won
144145
{

0 commit comments

Comments
 (0)