Hey there, is there a public API to discover the k...
# reflect
m
Hey there, is there a public API to discover the kind (
CLASS
,
FILE_FACADE
, …) of a Kotlin class?
u
The most stable way to check if a class is a regular Kotlin class (
CLASS
) would be to load the
@kotlin.Metadata
annotation on it, and check if the value of its
k
field is
1
. This will not break in foreseeable future, because even the Kotlin compiler relies on it since 1.0. See kdoc on
Metadata.k
for more information
👍 1