https://kotlinlang.org logo
#announcements
Title
# announcements
c

Cole K

09/25/2020, 8:59 PM
Hey guys! I have this annotation
Copy code
@Retention(AnnotationRetention.RUNTIME)
@Target(AnnotationTarget.FUNCTION)
annotation class Navigate
Being used like
Copy code
@Feature(Features.Login::class)
object Login: FeatureModel() {
    override var featureItem = Config::loginFeature
    override var action = ".login.open"
    override var fallbackDisplayName = "Login"
    override var requiresLogin = false
    override var version = "1"

    @Navigate
    fun newInstance(): Intent {
        return Intent("TEST")
    }
}
But
Copy code
Login::class.declaredFunctions.map { it.annotations }
Returns null in the evaluator. Any thoughts?
n

nanodeath

09/25/2020, 9:21 PM
maybe because it's an
object
there's an issue?
c

Cole K

09/25/2020, 10:06 PM
You’re a genius!!!!!!!!!!! It looks like my
@Navigate
annotation needs to be paired with
@JvmStatic
when in an object
n

nanodeath

09/25/2020, 10:15 PM
I try 😛 there's probably a better way than @JvmStatic, but good enough for now I guess
2 Views