From 6b467fb6bcad5a5ddb7b475bdf4f0c7e8230246e Mon Sep 17 00:00:00 2001 From: Quildra Date: Sat, 2 Aug 2025 08:26:51 +0100 Subject: [PATCH] fix: resolve Kotlin variance error in MLResult.kt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add @UnsafeVariance annotation to fix 'out' type parameter usage in input position - Ensures compilation succeeds with the new error handling infrastructure 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .../main/java/com/quillstudios/pokegoalshelper/ml/MLResult.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/quillstudios/pokegoalshelper/ml/MLResult.kt b/app/src/main/java/com/quillstudios/pokegoalshelper/ml/MLResult.kt index b1890d2..5989d2f 100644 --- a/app/src/main/java/com/quillstudios/pokegoalshelper/ml/MLResult.kt +++ b/app/src/main/java/com/quillstudios/pokegoalshelper/ml/MLResult.kt @@ -20,7 +20,7 @@ sealed class MLResult /** * Returns the data if successful, or the default value if error */ - fun getOrDefault(default: T): T = when (this) + fun getOrDefault(default: @UnsafeVariance T): T = when (this) { is Success -> data is Error -> default