Hi how can I annotate the class used in an Extensi...
# kotlin-native
r
Hi how can I annotate the class used in an Extension function and not the returned type of this function e.g.
Copy code
@ColorRes, @ColorInt
fun Int.doSomthing(): Int {
return getColor(this)
}
so the extension function is for @ColorRes Int, and the return type is @ColorInt if I annotate the function with @ColorRes it will take it as a return type annotation but I can’t seem to find how to annotate the main class the extension is made of
m
But since that is a Java annotation, I don't think it will work
r
ah, it actually worked 😄
thanks alot!
n
The original post isn't Kotlin Native related.