Hi! Had to move method from class to extention and...
# reflect
i
Hi! Had to move method from class to extention and now it throws
java.lang.IllegalAccessException: Class clean.db.entities.LocalizationDbEntityKt can not access a member of class infin.api.core.legal.entities.auth.login.LocalizationFromServer with modifiers "private final"
Copy code
fun LocalizationFromServer.toList() = LocalizationFromServer::class.java.declaredFields.map {
    LocalizationDbEntity(it.name, it.get(this)?.toString())
}
Cah anyone help pls?
r
You should be able to call
it.setAccessible
in your
map { }
before calling
it.get
, or something like that
👍 1
i
Thanks, setting
it.isAccessible = true
worked!
👌 1