[FIR] Fix handling of WRONG_MODIFIER_TARGET

Implement DEPRECATED_MODIFIER, DEPRECATED_MODIFIER_FOR_TARGET, REDUNDANT_MODIFIER_FOR_TARGET
This commit is contained in:
Ivan Kochurkin
2021-08-04 20:20:38 +03:00
committed by TeamCityServer
parent e85940a1ac
commit cd6384eb20
114 changed files with 504 additions and 1033 deletions
@@ -1,15 +0,0 @@
annotation class B
class A {
annotation companion object {}
}
annotation object O {}
annotation interface T {}
annotation fun f() = 0
annotation val x = 0
annotation var y = 0
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
annotation class B
class A {
@@ -4,7 +4,7 @@
annotation class Ann
fun foo() {
for (@Ann private x in 1..100) {
for (@Ann <!WRONG_MODIFIER_TARGET!>private<!> x in 1..100) {
if (x == 1) return
}
}
}
@@ -1,7 +0,0 @@
@Target(AnnotationTarget.CLASS)
annotation class My
data class Pair(val a: Int, val b: Int)
fun foo(): Int {
val (<!WRONG_ANNOTATION_TARGET!>@My<!> private a, <!WRONG_ANNOTATION_TARGET!>@My<!> public b) = Pair(12, 34)
return a + b
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
@Target(AnnotationTarget.CLASS)
annotation class My
data class Pair(val a: Int, val b: Int)
@@ -1,8 +0,0 @@
// KT-9145
@Target(AnnotationTarget.CLASS)
annotation class Ann
var x: Int
get() = 1
set(<!WRONG_ANNOTATION_TARGET!>@Ann<!> private x) { }
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// KT-9145
@Target(AnnotationTarget.CLASS)