[AA LC] Add test for modifiers of delegate fields
This commit is contained in:
committed by
Space Team
parent
95f5848e6c
commit
34af013913
+76
@@ -0,0 +1,76 @@
|
||||
public static abstract class Base /* Container.Base*/ {
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
private final Container.Delegate<java.lang.String> a$delegate;
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
private final Container.Delegate<java.lang.String> b$delegate;
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
private final java.lang.String c = "" /* initializer type: java.lang.String */;
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public abstract java.lang.String getD();// getD()
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public final java.lang.String getA();// getA()
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public java.lang.String getB();// getB()
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public java.lang.String getC();// getC()
|
||||
|
||||
public Base();// .ctor()
|
||||
}
|
||||
|
||||
public static final class Companion /* Container.Companion*/ {
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public final <R> Container.Delegate<R> delegate();// <R> delegate()
|
||||
|
||||
private Companion();// .ctor()
|
||||
}
|
||||
|
||||
public final class Container /* Container*/ {
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public static final Container.Companion Companion;
|
||||
|
||||
public Container();// .ctor()
|
||||
|
||||
class Base ...
|
||||
|
||||
class Companion ...
|
||||
|
||||
class Delegate ...
|
||||
|
||||
class Derived ...
|
||||
}
|
||||
|
||||
public static abstract interface Delegate /* Container.Delegate*/<R> {
|
||||
public abstract R getValue(@org.jetbrains.annotations.Nullable() java.lang.Object, @org.jetbrains.annotations.NotNull() kotlin.reflect.KProperty<?>);// getValue(java.lang.Object, kotlin.reflect.KProperty<?>)
|
||||
|
||||
public abstract void setValue(@org.jetbrains.annotations.Nullable() java.lang.Object, @org.jetbrains.annotations.NotNull() kotlin.reflect.KProperty<?>, R);// setValue(java.lang.Object, kotlin.reflect.KProperty<?>, R)
|
||||
|
||||
class DefaultImpls ...
|
||||
}
|
||||
|
||||
public static final class Derived /* Container.Derived*/ extends Container.Base {
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
private final Container.Delegate<java.lang.String> b$delegate;
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
private final Container.Delegate<java.lang.String> c$delegate;
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
private final Container.Delegate<java.lang.String> d$delegate;
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public java.lang.String getB();// getB()
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public java.lang.String getC();// getC()
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public java.lang.String getD();// getD()
|
||||
|
||||
public Derived();// .ctor()
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
public static abstract class Base /* Container.Base*/ {
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
private final Container.Delegate a$delegate;
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
private final Container.Delegate b$delegate;
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
private final java.lang.String c;
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public abstract java.lang.String getD();// getD()
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public final java.lang.String getA();// getA()
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public java.lang.String getB();// getB()
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public java.lang.String getC();// getC()
|
||||
|
||||
public Base();// .ctor()
|
||||
}
|
||||
|
||||
public static final class Companion /* Container.Companion*/ {
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public final <R> Container.Delegate<R> delegate();// <R> delegate()
|
||||
|
||||
private Companion();// .ctor()
|
||||
}
|
||||
|
||||
public final class Container /* Container*/ {
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public static final Container.Companion Companion;
|
||||
|
||||
public Container();// .ctor()
|
||||
|
||||
class Base ...
|
||||
|
||||
class Companion ...
|
||||
|
||||
class Delegate ...
|
||||
|
||||
class Derived ...
|
||||
}
|
||||
|
||||
public static abstract interface Delegate /* Container.Delegate*/<R> {
|
||||
public abstract R getValue(@org.jetbrains.annotations.Nullable() java.lang.Object, @org.jetbrains.annotations.NotNull() kotlin.reflect.KProperty<?>);// getValue(java.lang.Object, kotlin.reflect.KProperty<?>)
|
||||
|
||||
public abstract void setValue(@org.jetbrains.annotations.Nullable() java.lang.Object, @org.jetbrains.annotations.NotNull() kotlin.reflect.KProperty<?>, R);// setValue(java.lang.Object, kotlin.reflect.KProperty<?>, R)
|
||||
|
||||
class DefaultImpls ...
|
||||
}
|
||||
|
||||
public static final class Derived /* Container.Derived*/ extends Container.Base {
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
private final Container.Delegate b$delegate;
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
private final Container.Delegate c$delegate;
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
private final Container.Delegate d$delegate;
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public java.lang.String getB();// getB()
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public java.lang.String getC();// getC()
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public java.lang.String getD();// getD()
|
||||
|
||||
public Derived();// .ctor()
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
// Container
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
class Container {
|
||||
companion object {
|
||||
fun <R> delegate(): Delegate<R> = null!!
|
||||
}
|
||||
|
||||
interface Delegate<R> {
|
||||
operator fun getValue(thisRef: Any?, property: KProperty<*>): R = null!!
|
||||
|
||||
operator fun setValue(thisRef: Any?, property: KProperty<*>, value: R) {
|
||||
}
|
||||
}
|
||||
|
||||
abstract class Base {
|
||||
val a: String by delegate()
|
||||
open val b: String by delegate()
|
||||
open val c: String = ""
|
||||
abstract val d: String
|
||||
}
|
||||
|
||||
class Derived : Base() {
|
||||
override val b: String by delegate()
|
||||
override val c: String by delegate()
|
||||
override val d: String by delegate()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user