gpeal
08/17/2020, 6:58 PMmikhail.zarechenskiy
08/17/2020, 8:52 PMgpeal
08/17/2020, 9:41 PMgpeal
08/17/2020, 9:43 PMNot enough information to infer type variable P
This is in code or a scratch file created from within an Android project in Android Studio if that mattersgpeal
08/17/2020, 9:45 PMmikhail.zarechenskiy
08/17/2020, 9:51 PMgpeal
08/17/2020, 10:03 PMe: /home/gabriel/repos/MvRx/counter/src/main/java/com/airbnb/mvrx/counter/CounterFragment.kt: (25, 48): Type 'MavericksDelegateProvider<TypeVariable(T), TypeVariable(VM)>' has no method 'getValue(CounterFragment, KProperty<*>)' and thus it cannot serve as a delegate
gpeal
08/17/2020, 10:58 PMimport kotlin.properties.PropertyDelegateProvider
import kotlin.properties.ReadOnlyProperty
class TypeInference {
val works by providerFun<TypeInference, String>()
val doesntWork: String by providerFun()
}
inline fun <T, reified V> T.providerFun() = PropertyDelegateProvider { _: T, _ ->
ReadOnlyProperty<T, V> { _, _ -> TODO("Not Implemented") }
}
gpeal
08/17/2020, 10:59 PMgpeal
08/18/2020, 1:14 AM