https://kotlinlang.org logo
#getting-started
Title
# getting-started
e

elect

10/15/2023, 3:03 PM
in multiplatform, if I need to access an internal field in a third (kotlin) library, is reflection the way to go?
y

Youssef Shoaib [MOD]

10/15/2023, 4:58 PM
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
does the trick, and if eventually the compiler disallows it, then yes reflection would do the trick.
e

elect

10/15/2023, 5:59 PM
yeah, I saw, but unfortunately the reflection support on MP is almost inexistent..
c

CLOVIS

10/16/2023, 12:17 PM
In general, you should ask the library authors to make it
public
. You don't know when the field will disappear.
e

elect

10/16/2023, 12:22 PM
yeah, it's not a long term approach