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:
Vendored
+2
-2
@@ -5,6 +5,6 @@ fun test1(<!WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@<!INAPPLICABLE_FILE_T
|
||||
<!WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@<!INAPPLICABLE_FILE_TARGET!>file<!> <!SYNTAX!>@<!>Suppress("")<!>
|
||||
fun test2() {}
|
||||
|
||||
class OnType(x: <!WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@file<!SYNTAX!><!> Suppress("")<!> Int)
|
||||
class OnType(x: <!WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET_ON_TYPE, WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@file<!SYNTAX!><!> Suppress("")<!> Int)
|
||||
|
||||
fun <!WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@file : Suppress("")<!> Int.test3() {}
|
||||
fun <!WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET_ON_TYPE, WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@file : Suppress("")<!> Int.test3() {}
|
||||
Reference in New Issue
Block a user