You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suppose you have a data class with a private parameter:
data classTest(
vala:String,
privatevalb:String,
)
Calling pprint(Test("a", "b")) will result in the following exception:
kotlin.reflect.full.IllegalCallableAccessException: java.lang.IllegalAccessException:Class java.lang.Class<kotlin.reflect.jvm.internal.calls.CallerImpl$FieldGetter> cannot access privatefinal field java.lang.String com.test.Test.b of classjava.lang.Class<com.test.Test>
at kotlin.reflect.jvm.internal.KCallableImpl.call(KCallableImpl.kt:280)
at kotlin.reflect.jvm.internal.KProperty1Impl.get(KProperty1Impl.kt:35)
at kotlin.reflect.jvm.internal.KProperty1Impl.invoke(KProperty1Impl.kt:41)
<pprint callsite>
The text was updated successfully, but these errors were encountered:
Suppose you have a data class with a private parameter:
Calling
pprint(Test("a", "b"))
will result in the following exception:The text was updated successfully, but these errors were encountered: