ribesg
10/10/2018, 9:51 AMconst val
property?diesieben07
10/10/2018, 9:55 AMval
.ribesg
10/10/2018, 9:57 AMjava.lang.IllegalArgumentException: Callable expects 0 arguments, but 1 were provided.
at kotlin.reflect.jvm.internal.calls.Caller$DefaultImpls.checkArguments(Caller.kt:20)
at kotlin.reflect.jvm.internal.calls.CallerImpl.checkArguments(CallerImpl.kt:15)
at kotlin.reflect.jvm.internal.calls.CallerImpl$FieldGetter.call(CallerImpl.kt:134)
at kotlin.reflect.jvm.internal.KCallableImpl.call(KCallableImpl.kt:106)
at kotlin.reflect.jvm.internal.KProperty1Impl.get(KProperty1Impl.kt:35)
ribesg
10/10/2018, 9:58 AMKProperty1Impl.get
method both requires an argument and crashes when one is provided... Somehowribesg
10/10/2018, 9:59 AMconst
, so I'm not blocked, but my question still stands.diesieben07
10/10/2018, 9:59 AMKProperty1
for a const val
. const val
can only be top level (KProperty0
) or in an object (also KProperty0
).ribesg
10/10/2018, 10:00 AMdeclaredMemberProperties
which is a Collection<KProperty1<T, *>>
. It's an object containing only `const val`sribesg
10/10/2018, 10:01 AMdiesieben07
10/10/2018, 10:01 AMribesg
10/10/2018, 10:02 AMdeclaredMemberProperties
, they are in therediesieben07
10/10/2018, 10:03 AMval value = if (prop.isConst) {
prop.javaField!!.get(null)
} else {
prop.get(<receiver>)
}
diesieben07
10/10/2018, 10:03 AMribesg
10/10/2018, 10:18 AMribesg
10/10/2018, 10:22 AMdiesieben07
10/10/2018, 10:23 AMdiesieben07
10/10/2018, 10:23 AMribesg
10/10/2018, 10:24 AMribesg
10/10/2018, 10:25 AM