File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
firebase-remoteconfig/src/commonMain/kotlin/dev/gitlive/firebase/remoteconfig Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -23,16 +23,17 @@ expect class FirebaseRemoteConfig {
23
23
suspend fun setDefaults (vararg defaults : Pair <String , Any ?>)
24
24
}
25
25
26
+ @Suppress(" IMPLICIT_CAST_TO_ANY" )
26
27
inline operator fun <reified T > FirebaseRemoteConfig.get (key : String ): T {
27
28
val configValue = getValue(key)
28
29
return when (T ::class ) {
29
- Boolean ::class -> configValue.asBoolean() as T
30
- Double ::class -> configValue.asDouble() as T
31
- Long ::class -> configValue.asLong() as T
32
- String ::class -> configValue.asString() as T
33
- FirebaseRemoteConfigValue ::class -> configValue as T
30
+ Boolean ::class -> configValue.asBoolean()
31
+ Double ::class -> configValue.asDouble()
32
+ Long ::class -> configValue.asLong()
33
+ String ::class -> configValue.asString()
34
+ FirebaseRemoteConfigValue ::class -> configValue
34
35
else -> throw IllegalArgumentException ()
35
- }
36
+ } as T
36
37
}
37
38
38
39
expect open class FirebaseRemoteConfigException : FirebaseException
You can’t perform that action at this time.
0 commit comments