Repository navigation
Fix type inference for MutableStore.get() and fresh() extensions (#555) - #766
Open
binayshaw7777 wants to merge 1 commit into
Open
binayshaw7777 wants to merge 1 commit into
binayshaw7777 wants to merge 1 commit into
Conversation
…ileNativeFoundation#555) - Remove unused <Response : Any> generic parameter from MutableStore.get() and fresh() extensions. - Default internal stream calls to Unit to allow natural invocation without explicit generic arguments. - Add unit tests in RealMutableStoreTest and connectedAndroidDeviceTest on emulator-5554. Signed-off-by: Binay Shaw <binayshaw7777@gmail.com>
binayshaw7777
force-pushed
the
binay/fix-mutablestore-get-fresh
branch
from
November 21, 2026 10:50
29dca00 to
93dc82b
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #555
Description
Calls to
mutableStore.get(key)andmutableStore.fresh(key)failed compilation withCannot infer type parameter Responsebecause<Response : Any>was declared on the extension function without being present in parameters or return type.This PR updates
MutableStore.get()andMutableStore.fresh()to specify<Key : Any, Output : Any>and default the internal stream call toUnit. Callers can now usemutableStore.get(key)andmutableStore.fresh(key)without manually supplying unused generic parameters.Type of Change
Test Plan
get_givenCachedData_returnsDataDirectlyWithoutExplicitResponseGenericandfresh_givenFetcherData_returnsFreshDataDirectlyWithoutExplicitResponseGenericinRealMutableStoreTest.kt.TestSourceOfTruthto avoid ClassCastException during test execution.MutableStoreDeviceTestunderandroidDeviceTestverifyingmutableStore.get()andfresh()without explicit response generic on real Android environment../gradlew :store:jvmTest(Pass)./gradlew :store:spotlessCheck(Pass)./gradlew :store:apiCheck(Pass)./gradlew :store:connectedAndroidDeviceTestonemulator-5554(Pixel 10 / Android 17, Pass)Checklist