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

oday

03/20/2022, 10:08 PM
this is an excerpt from https://developer.android.com/codelabs/kotlin-bootcamp-sams#1
Copy code
import kotlin.reflect.full.*

class Plant{
    fun trim(){}
    fun fertilize(){}
}

fun testAnnotations(){
    val classObj = Plant::class

    for (m in classObj.declaredMemberFunctions){
        println(m.name)
    }
}
declaredMemberFunctions
is still unrecognized
j

Joffrey

03/20/2022, 11:08 PM
Did you add a Gradle dependency on
kotlin-reflect
?
o

oday

03/21/2022, 11:10 AM
this is in the standard library though
import line didn’t show any erorrs
2 Views