when i use Jetpack compose:
@Composable
fun parentFuncNeedComp( func:@Composable ()->Unit){
func()
}
I can't move @Composable before func like:
@Composable func: ()->Unit
It said: This annotation is not applicable to target 'value parameter'
And I make a custom annotation named MyAnnotation, and I code a example:
@MyAnnotation
fun func1() {
println("func1")
}
fun func2() {
println("func2")
}
fun parentFunc(@MyAnnotation func:@MyAnnotation ()->Unit){
func()
}
fun main() {
parentFunc(::func2)
parentFunc(::func1)
}
Why both of them work?! And what' s the diff of the @MyAnnotation location?