FirPropertyAccessorChecker: add three new diagnostics

This commit is contained in:
Mikhail Glukhikh
2021-05-07 12:28:56 +03:00
parent 1a3b5657c7
commit 6618b4ea57
23 changed files with 131 additions and 96 deletions
@@ -1,12 +0,0 @@
// KT-11809 Assertion error when delegated property has getter
class A {
val p1 by this
get
var p2 by this
get() = ""
operator fun getValue(a: Any?, p: Any?) = ""
operator fun setValue(a: Any?, p: Any?, v: Any?) {}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// KT-11809 Assertion error when delegated property has getter
class A {
@@ -1,12 +0,0 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
import kotlin.reflect.KProperty
val a: Int by Delegate()
get() = 1
class Delegate {
operator fun getValue(t: Any?, p: KProperty<*>): Int {
return 1
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_PARAMETER
import kotlin.reflect.KProperty
@@ -1,15 +0,0 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
import kotlin.reflect.KProperty
var a: Int by Delegate()
get() = 1
set(i) {}
class Delegate {
operator fun getValue(t: Any?, p: KProperty<*>): Int {
return 1
}
operator fun setValue(t: Any?, p: KProperty<*>, i: Int) {}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_PARAMETER
import kotlin.reflect.KProperty