[FIR] Add INAPPLICABLE_OPERATOR_MODIFIER diagnostic

This commit is contained in:
Andrey Zinovyev
2021-08-16 14:59:20 +03:00
committed by TeamCityServer
parent 16f41bd80c
commit 1cd321a90f
37 changed files with 388 additions and 238 deletions
@@ -35,7 +35,7 @@ class MyProperty2<T, R> {
throw Exception()
}
operator fun setValue(i: Int) {
<!INAPPLICABLE_OPERATOR_MODIFIER!>operator<!> fun setValue(i: Int) {
println("set")
}
}
@@ -1,32 +0,0 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
import kotlin.reflect.KProperty
operator fun provideDelegate(x: Any?, p: KProperty<*>) {}
operator fun Any.provideDelegate(x: Any?, p: KProperty<*>) {}
operator fun Any.provideDelegate(x: Any?, p: Any) {}
operator fun Any.provideDelegate(x: Any?, p: Int) {}
class Host1 {
operator fun provideDelegate(x: Any?, p: KProperty<*>) {}
}
class Host2 {
operator fun Any.provideDelegate(x: Any?, p: KProperty<*>) {}
}
class Host3 {
operator fun provideDelegate(x: Any?, p: KProperty<*>, foo: Int) {}
}
class Host4 {
operator fun provideDelegate(x: Any?, p: KProperty<*>, foo: Int = 0) {}
}
class Host5 {
operator fun provideDelegate(x: Any?, p: KProperty<*>, vararg foo: Int) {}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_PARAMETER
import kotlin.reflect.KProperty