Introduce FIR_IDENTICAL for FIR vs old frontend tests #KT-36879 Fixed
This commit is contained in:
-11
@@ -1,11 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
val a: Int by Delegate()
|
||||
|
||||
class Delegate {
|
||||
operator fun getValue(t: Any?, p: KProperty<*>): Int {
|
||||
return 1
|
||||
}
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
val a by Delegate()
|
||||
|
||||
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
|
||||
|
||||
class B {
|
||||
val a: Int by Delegate()
|
||||
|
||||
fun foo() =<!SYNTAX!><!> <!SYNTAX!>$a<!>
|
||||
}
|
||||
|
||||
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,12 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
val a: Int by Delegate()
|
||||
get
|
||||
|
||||
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,14 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
var a: Int by Delegate()
|
||||
private set
|
||||
|
||||
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
|
||||
|
||||
Vendored
-21
@@ -1,21 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
interface A {
|
||||
val prop: Int
|
||||
}
|
||||
|
||||
class AImpl: A {
|
||||
override val prop by Delegate()
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
AImpl().prop
|
||||
}
|
||||
|
||||
class Delegate {
|
||||
operator fun getValue(t: Any?, p: KProperty<*>): Int {
|
||||
return 1
|
||||
}
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
val a: Int by A(1)
|
||||
|
||||
class A<T: Any>(i: T) {
|
||||
operator fun getValue(t: Any?, p: KProperty<*>): T {
|
||||
throw Exception()
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
open class Base
|
||||
class Derived: Base()
|
||||
|
||||
val a: Base by A()
|
||||
|
||||
class A {
|
||||
operator fun getValue(t: Any?, p: KProperty<*>): Derived {
|
||||
return Derived()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
-17
@@ -1,17 +0,0 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class Inv2<T, K>
|
||||
|
||||
fun <T, K> create(g: (T) -> K): Inv2<T, K> = TODO()
|
||||
|
||||
operator fun <S1, V1> Inv2<S1, V1>.getValue(o: Sample, desc: KProperty<*>): V1 = TODO()
|
||||
operator fun <S2, V2> Inv2<S2, V2>.setValue(o: Sample, desc: KProperty<*>, value: V2) {}
|
||||
|
||||
class Version(val version: Int)
|
||||
|
||||
class Sample {
|
||||
var version: Version by create(::Version)
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
|
||||
Vendored
-22
@@ -1,22 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE, -UNUSED_PARAMETER
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
fun test(i: Int) {
|
||||
val bad by myLazyDelegate {
|
||||
createSample(i) { it.toString() }
|
||||
}
|
||||
|
||||
takeSample(bad)
|
||||
}
|
||||
|
||||
fun <T> myLazyDelegate(i: () -> T): LazyDelegate<T> = LazyDelegate(i())
|
||||
|
||||
class LazyDelegate<T>(val v: T) {
|
||||
operator fun getValue(thisRef: Any?, property: KProperty<*>): T = TODO()
|
||||
}
|
||||
|
||||
class Sample<K, V>
|
||||
|
||||
fun takeSample(g: Sample<Int, String>) {}
|
||||
fun <T, S> createSample(i: T, a: (T) -> S): Sample<T, S> = TODO()
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE, -UNUSED_PARAMETER
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE
|
||||
|
||||
class Delegate<T>
|
||||
|
||||
operator fun <T> Delegate<T>.getValue(thisRef: Any?, property: kotlin.reflect.KProperty<*>): T = TODO()
|
||||
|
||||
fun <K> createDelegate(f: () -> K): Delegate<K> = TODO()
|
||||
|
||||
fun test() {
|
||||
val bar: () -> String by createDelegate {
|
||||
return@createDelegate { "str" }
|
||||
}
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE
|
||||
|
||||
|
||||
-35
@@ -1,35 +0,0 @@
|
||||
package foo
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class A1 {
|
||||
val a: String by MyProperty1()
|
||||
}
|
||||
|
||||
class MyProperty1 {}
|
||||
operator fun MyProperty1.getValue(thisRef: Any?, desc: KProperty<*>): String {
|
||||
throw Exception("$thisRef $desc")
|
||||
}
|
||||
|
||||
//--------------------
|
||||
|
||||
class A2 {
|
||||
val a: String by MyProperty2()
|
||||
}
|
||||
|
||||
class MyProperty2<T> {}
|
||||
operator fun <T> MyProperty2<T>.getValue(thisRef: Any?, desc: KProperty<*>): T {
|
||||
throw Exception("$thisRef $desc")
|
||||
}
|
||||
|
||||
//--------------------
|
||||
|
||||
class A3 {
|
||||
val a: String by MyProperty3()
|
||||
|
||||
class MyProperty3<T> {}
|
||||
|
||||
operator fun <T> MyProperty3<T>.getValue(thisRef: Any?, desc: KProperty<*>): T {
|
||||
throw Exception("$thisRef $desc")
|
||||
}
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
package foo
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
-17
@@ -1,17 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class A<E>
|
||||
class B<E, F>
|
||||
|
||||
fun <K, V> A<K>.toB(f: (V) -> K, g: (K) -> V): B<K, V> = B()
|
||||
|
||||
operator fun <T1, E1> B<T1, E1>.getValue(o: Any, desc: KProperty<*>): E1 = TODO()
|
||||
operator fun <T2, E2> B<T2, E2>.setValue(o: Any, desc: KProperty<*>, value: E2) {}
|
||||
|
||||
val q = A<String>()
|
||||
|
||||
class Test {
|
||||
var prop by q.toB({ "abc" }, { "cde" })
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
-29
@@ -1,29 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
val b: First by lazy {
|
||||
object : First { }
|
||||
}
|
||||
|
||||
private val withoutType by lazy {
|
||||
object : First { }
|
||||
}
|
||||
|
||||
private val withTwoSupertypes by lazy {
|
||||
object : First, Second { }
|
||||
}
|
||||
|
||||
class A<T> {
|
||||
val a: First by lazy {
|
||||
object : First { }
|
||||
}
|
||||
}
|
||||
|
||||
interface First
|
||||
interface Second
|
||||
|
||||
fun <T> lazy(initializer: () -> T): Lazy<T> = TODO()
|
||||
interface Lazy<out T> {
|
||||
operator fun getValue(thisRef: Any?, property: KProperty<*>): T = TODO()
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class A {
|
||||
val a by MyProperty()
|
||||
|
||||
fun test() {
|
||||
checkSubtype<Int>(a)
|
||||
}
|
||||
}
|
||||
|
||||
class MyProperty<R> {
|
||||
operator fun getValue(thisRef: R, desc: KProperty<*>): Int = throw Exception("$thisRef $desc")
|
||||
}
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !CHECK_TYPE
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
-76
@@ -1,76 +0,0 @@
|
||||
package foo
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class A1 {
|
||||
var a1: String by MyProperty1()
|
||||
var b1: String by getMyProperty1()
|
||||
}
|
||||
|
||||
var c1: String by getMyProperty1()
|
||||
var d1: String by MyProperty1()
|
||||
|
||||
fun <A, B> getMyProperty1() = MyProperty1<A, B>()
|
||||
|
||||
class MyProperty1<R, T> {
|
||||
|
||||
operator fun getValue(thisRef: R, desc: KProperty<*>): T {
|
||||
println("get $thisRef ${desc.name}")
|
||||
throw Exception()
|
||||
}
|
||||
|
||||
operator fun setValue(thisRef: R, desc: KProperty<*>, value: T) {
|
||||
println("set $thisRef ${desc.name} $value")
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------
|
||||
|
||||
class A2 {
|
||||
var a2: String by MyProperty2()
|
||||
var b2: String by getMyProperty2()
|
||||
}
|
||||
|
||||
var c2: String by getMyProperty2()
|
||||
var d2: String by MyProperty2()
|
||||
|
||||
fun <A> getMyProperty2() = MyProperty2<A>()
|
||||
|
||||
class MyProperty2<T> {
|
||||
|
||||
operator fun getValue(thisRef: Any?, desc: KProperty<*>): T {
|
||||
println("get $thisRef ${desc.name}")
|
||||
throw Exception()
|
||||
}
|
||||
|
||||
operator fun setValue(thisRef: Any?, desc: KProperty<*>, value: T) {
|
||||
println("set $thisRef ${desc.name} $value")
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------
|
||||
|
||||
class A3 {
|
||||
var a3: String by MyProperty3()
|
||||
var b3: String by getMyProperty3()
|
||||
}
|
||||
|
||||
var c3: String by getMyProperty3()
|
||||
var d3: String by MyProperty3()
|
||||
|
||||
fun <A> getMyProperty3() = MyProperty3<A>()
|
||||
|
||||
class MyProperty3<T> {
|
||||
|
||||
operator fun getValue(thisRef: T, desc: KProperty<*>): String {
|
||||
println("get $thisRef ${desc.name}")
|
||||
return ""
|
||||
}
|
||||
|
||||
operator fun setValue(thisRef: Any?, desc: KProperty<*>, value: T) {
|
||||
println("set $thisRef ${desc.name} $value")
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------
|
||||
fun println(a: Any?) = a
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
package foo
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
Vendored
-64
@@ -1,64 +0,0 @@
|
||||
package foo
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class A1 {
|
||||
val a1: String by MyProperty1()
|
||||
val b1: String by getMyProperty1()
|
||||
}
|
||||
|
||||
val c1: String by getMyProperty1()
|
||||
val d1: String by MyProperty1()
|
||||
|
||||
fun <A, B> getMyProperty1() = MyProperty1<A, B>()
|
||||
|
||||
class MyProperty1<R, T> {
|
||||
|
||||
operator fun getValue(thisRef: R, desc: KProperty<*>): T {
|
||||
println("get $thisRef ${desc.name}")
|
||||
throw Exception()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------
|
||||
|
||||
class A2 {
|
||||
val a2: String by MyProperty2()
|
||||
val b2: String by getMyProperty2()
|
||||
}
|
||||
|
||||
val c2: String by getMyProperty2()
|
||||
val d2: String by MyProperty2()
|
||||
|
||||
fun <A> getMyProperty2() = MyProperty2<A>()
|
||||
|
||||
class MyProperty2<T> {
|
||||
|
||||
operator fun getValue(thisRef: Any?, desc: KProperty<*>): T {
|
||||
println("get $thisRef ${desc.name}")
|
||||
throw Exception()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------
|
||||
|
||||
class A3 {
|
||||
val a3: String by MyProperty3()
|
||||
val b3: String by getMyProperty3()
|
||||
}
|
||||
|
||||
val c3: String by getMyProperty3()
|
||||
val d3: String by MyProperty3()
|
||||
|
||||
fun <A> getMyProperty3() = MyProperty3<A>()
|
||||
|
||||
class MyProperty3<T> {
|
||||
|
||||
operator fun getValue(thisRef: T, desc: KProperty<*>): String {
|
||||
println("get $thisRef ${desc.name}")
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------
|
||||
fun println(a: Any?) = a
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
package foo
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class Local {
|
||||
fun foo() {
|
||||
val a: Int by Delegate()
|
||||
}
|
||||
}
|
||||
|
||||
class Delegate {
|
||||
operator fun getValue(t: Any?, p: KProperty<*>): Int {
|
||||
return 1
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
Vendored
-13
@@ -1,13 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
class Cell<out V>(val value: V)
|
||||
|
||||
class GenericDelegate<V>(val value: V)
|
||||
|
||||
operator fun <T> T.provideDelegate(a: Any?, p: Any?) = GenericDelegate(this)
|
||||
|
||||
operator fun <W> GenericDelegate<W>.getValue(a: Any?, p: Any?) = Cell(value)
|
||||
|
||||
val test1: Cell<String> by "OK"
|
||||
val test2: Cell<Any> by "OK"
|
||||
val test3 by "OK"
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
class Cell<out V>(val value: V)
|
||||
|
||||
Vendored
-12
@@ -1,12 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
object T3 {
|
||||
interface Foo<T>
|
||||
|
||||
fun <T> delegate(): Foo<T> = TODO()
|
||||
|
||||
operator fun <T> Foo<T>.provideDelegate(host: T3, p: Any?): Foo<T> = TODO()
|
||||
operator fun <T> Foo<T>.getValue(receiver: T3, p: Any?): T = TODO()
|
||||
|
||||
val test1: String by delegate()
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
object T3 {
|
||||
|
||||
Vendored
-11
@@ -1,11 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
operator fun String.provideDelegate(a: Any?, p: KProperty<*>) = this
|
||||
operator fun String.getValue(a: Any?, p: KProperty<*>) = this
|
||||
|
||||
fun test(): String {
|
||||
val result by "OK"
|
||||
return result
|
||||
}
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
object Foo
|
||||
object Bar
|
||||
object Baz
|
||||
|
||||
operator fun Foo.provideDelegate(receiver: Any?, property: KProperty<*>) = this
|
||||
operator fun Bar.provideDelegate(receiver: Any?, property: KProperty<*>) = this
|
||||
|
||||
operator fun Foo.getValue(nothing: Any?, property: KProperty<*>): Any = TODO()
|
||||
operator fun Bar.getValue(nothing: Any?, property: KProperty<*>): Any = TODO()
|
||||
operator fun Baz.getValue(nothing: Any?, property: KProperty<*>): Any = TODO()
|
||||
|
||||
fun test() {
|
||||
val bar by Baz
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
|
||||
|
||||
Vendored
-10
@@ -1,10 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
operator fun String.provideDelegate(a: Any?, p: KProperty<*>) = this
|
||||
operator fun String.getValue(a: Any?, p: KProperty<*>) = this
|
||||
|
||||
val test1: String by "OK"
|
||||
|
||||
val test2 by "OK"
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
open class Base
|
||||
class Derived: Base()
|
||||
|
||||
var a: Derived by A()
|
||||
|
||||
class A {
|
||||
operator fun getValue(t: Any?, p: KProperty<*>): Derived {
|
||||
return Derived()
|
||||
}
|
||||
|
||||
operator fun setValue(t: Any?, p: KProperty<*>, i: Base) {}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class A
|
||||
|
||||
object Delegate {
|
||||
operator fun getValue(state: A, desc: KProperty<*>): Int = 0
|
||||
operator fun setValue(state: A, desc: KProperty<*>, value: Int) {}
|
||||
}
|
||||
|
||||
open class B {
|
||||
val A.foo: Int by Delegate
|
||||
var A.bar: Int by Delegate
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class A
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class A {
|
||||
var a: Int by Delegate()
|
||||
}
|
||||
|
||||
var aTopLevel: Int by Delegate()
|
||||
|
||||
class Delegate {
|
||||
operator fun getValue(t: Any?, p: KProperty<*>): Int {
|
||||
return 1
|
||||
}
|
||||
operator fun setValue(t: Any?, p: KProperty<*>, a: Int) {}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
var b: Int by Delegate()
|
||||
|
||||
class Delegate {
|
||||
operator fun getValue(t: Any?, p: KProperty<*>): Int {
|
||||
return 1
|
||||
}
|
||||
|
||||
operator fun setValue(t: Any?, p: KProperty<*>, i: Int): Int {
|
||||
return i
|
||||
}
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
Reference in New Issue
Block a user