Approximate types for lambda literals before serialization
This commit is contained in:
+24
@@ -0,0 +1,24 @@
|
||||
interface A
|
||||
interface B
|
||||
class Inv<T>(e: T)
|
||||
|
||||
fun <S> intersection(x: Inv<in S>, y: Inv<in S>): S = TODO()
|
||||
|
||||
fun <K> use(k: K, f: K.(K) -> K) {}
|
||||
fun <K> useNested(k: K, f: Inv<K>.(Inv<K>) -> Inv<K>) {}
|
||||
|
||||
fun <T> createDelegate(f: () -> T): Delegate<T> = Delegate()
|
||||
|
||||
class Delegate<T> {
|
||||
operator fun getValue(thisRef: Any?, property: kotlin.reflect.KProperty<*>): T = TODO()
|
||||
operator fun setValue(thisRef: Any?, property: kotlin.reflect.KProperty<*>, value: T) {}
|
||||
}
|
||||
|
||||
fun test(a: Inv<A>, b: Inv<B>) {
|
||||
val intersectionType = intersection(a, b)
|
||||
|
||||
use(intersectionType) { intersectionType }
|
||||
useNested(intersectionType) { Inv(intersectionType) }
|
||||
|
||||
var d by createDelegate { intersectionType }
|
||||
}
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
// A.class
|
||||
// ------------------------------------------
|
||||
public abstract interface A : kotlin/Any {
|
||||
|
||||
// module name: test-module
|
||||
}
|
||||
// B.class
|
||||
// ------------------------------------------
|
||||
public abstract interface B : kotlin/Any {
|
||||
|
||||
// module name: test-module
|
||||
}
|
||||
// Delegate.class
|
||||
// ------------------------------------------
|
||||
public final class Delegate<T#0 /* T */> : kotlin/Any {
|
||||
|
||||
// signature: <init>()V
|
||||
public /* primary */ constructor()
|
||||
|
||||
// signature: getValue(Ljava/lang/Object;Lkotlin/reflect/KProperty;)Ljava/lang/Object;
|
||||
public final operator fun getValue(thisRef: kotlin/Any?, property: kotlin/reflect/KProperty<*>): T#0
|
||||
|
||||
// signature: setValue(Ljava/lang/Object;Lkotlin/reflect/KProperty;Ljava/lang/Object;)V
|
||||
public final operator fun setValue(thisRef: kotlin/Any?, property: kotlin/reflect/KProperty<*>, value: T#0): kotlin/Unit
|
||||
|
||||
// module name: test-module
|
||||
}
|
||||
// IntersectionTypeInLambdaLiteralAndDelegatedPropertyKt.class
|
||||
// ------------------------------------------
|
||||
package {
|
||||
|
||||
// signature: createDelegate(Lkotlin/jvm/functions/Function0;)LDelegate;
|
||||
public final fun <T#0 /* T */> createDelegate(f: kotlin/Function0<T#0>): Delegate<T#0>
|
||||
|
||||
// signature: intersection(LInv;LInv;)Ljava/lang/Object;
|
||||
public final fun <T#0 /* S */> intersection(x: Inv<in T#0>, y: Inv<in T#0>): T#0
|
||||
|
||||
// signature: test(LInv;LInv;)V
|
||||
public final fun test(a: Inv<A>, b: Inv<B>): kotlin/Unit
|
||||
|
||||
// signature: use(Ljava/lang/Object;Lkotlin/jvm/functions/Function2;)V
|
||||
public final fun <T#0 /* K */> use(k: T#0, f: @kotlin/ExtensionFunctionType kotlin/Function2<T#0, T#0, T#0>): kotlin/Unit
|
||||
|
||||
// signature: useNested(Ljava/lang/Object;Lkotlin/jvm/functions/Function2;)V
|
||||
public final fun <T#0 /* K */> useNested(k: T#0, f: @kotlin/ExtensionFunctionType kotlin/Function2<Inv<T#0>, Inv<T#0>, Inv<T#0>>): kotlin/Unit
|
||||
|
||||
// local delegated property #0
|
||||
// local final /* delegated */ var d: kotlin/Any
|
||||
// local final get
|
||||
// local final set
|
||||
}
|
||||
// IntersectionTypeInLambdaLiteralAndDelegatedPropertyKt$test$1.class
|
||||
// ------------------------------------------
|
||||
lambda {
|
||||
|
||||
// signature: invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
||||
local final fun kotlin/Nothing.<anonymous>(it: kotlin/Nothing): kotlin/Any
|
||||
}
|
||||
// IntersectionTypeInLambdaLiteralAndDelegatedPropertyKt$test$2.class
|
||||
// ------------------------------------------
|
||||
lambda {
|
||||
|
||||
// signature: invoke(LInv;LInv;)LInv;
|
||||
local final fun kotlin/Nothing.<anonymous>(it: kotlin/Nothing): Inv<out kotlin/Any>
|
||||
}
|
||||
// IntersectionTypeInLambdaLiteralAndDelegatedPropertyKt$test$d$2.class
|
||||
// ------------------------------------------
|
||||
lambda {
|
||||
|
||||
// signature: invoke()Ljava/lang/Object;
|
||||
local final fun <anonymous>(): kotlin/Any
|
||||
}
|
||||
// Inv.class
|
||||
// ------------------------------------------
|
||||
public final class Inv<T#0 /* T */> : kotlin/Any {
|
||||
|
||||
// signature: <init>(Ljava/lang/Object;)V
|
||||
public /* primary */ constructor(e: T#0)
|
||||
|
||||
// module name: test-module
|
||||
}
|
||||
// META-INF/test-module.kotlin_module
|
||||
// ------------------------------------------
|
||||
module {
|
||||
package <root> {
|
||||
IntersectionTypeInLambdaLiteralAndDelegatedPropertyKt
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user