Prohibit incorrect annotations with use-site targets more precisely
#KT-21696 Fixed The problem is coming from the fact that `AnnotationTarget.VALUE_PARAMETER` is mapped to receiver parameter and to value parameter, but annotation with use-site target `receiver` can be used only on type reference of receiver parameter
This commit is contained in:
@@ -170,6 +170,14 @@ fun prefixExpressionRecursiveVisitor(block: (KtPrefixExpression) -> Unit) =
|
||||
}
|
||||
}
|
||||
|
||||
fun typeReferenceRecursiveVisitor(block: (KtTypeReference) -> Unit) =
|
||||
object : KtTreeVisitorVoid() {
|
||||
override fun visitTypeReference(typeReference: KtTypeReference) {
|
||||
super.visitTypeReference(typeReference)
|
||||
block(typeReference)
|
||||
}
|
||||
}
|
||||
|
||||
fun namedFunctionVisitor(block: (KtNamedFunction) -> Unit) =
|
||||
object : KtVisitorVoid() {
|
||||
override fun visitNamedFunction(namedFunction: KtNamedFunction) {
|
||||
|
||||
Reference in New Issue
Block a user