JVM_IR Do not generate generic signatures for lifted lambda methods
This commit is contained in:
committed by
TeamCityServer
parent
00a335129b
commit
737fbe271f
Vendored
+14
-22
@@ -2,36 +2,28 @@
|
||||
// WASM_MUTE_REASON: SAM_CONVERSIONS
|
||||
// !LANGUAGE: +InlineClasses
|
||||
|
||||
fun <T> underlying(a: IC): T = bar(a) {
|
||||
it.value as T
|
||||
fun <T1> underlying(a: IC): T1 = bar(a) { it.value as T1 }
|
||||
|
||||
fun <T2> extension(a: IC): T2 = bar(a) { it.extensionValue() }
|
||||
|
||||
fun <T3> dispatch(a: IC): T3 = bar(a) { it.dispatchValue() }
|
||||
|
||||
fun <T4> normal(a: IC): T4 = bar(a) { normalValue(it) }
|
||||
|
||||
fun interface FunIFace<T0, R> {
|
||||
fun call(ic: T0): R
|
||||
}
|
||||
|
||||
fun <T> extension(a: IC): T = bar(a) {
|
||||
it.extensionValue()
|
||||
}
|
||||
|
||||
fun <T> dispatch(a: IC): T = bar(a) {
|
||||
it.dispatchValue()
|
||||
}
|
||||
|
||||
fun <T> normal(a: IC): T = bar(a) {
|
||||
normalValue(it)
|
||||
}
|
||||
|
||||
fun interface FunIFace<T, R> {
|
||||
fun call(ic: T): R
|
||||
}
|
||||
|
||||
fun <T, R> bar(value: T, f: FunIFace<T, R>): R {
|
||||
fun <T5, R> bar(value: T5, f: FunIFace<T5, R>): R {
|
||||
return f.call(value)
|
||||
}
|
||||
|
||||
fun <T> IC.extensionValue(): T = value as T
|
||||
fun <T6> IC.extensionValue(): T6 = value as T6
|
||||
|
||||
fun <T> normalValue(ic: IC): T = ic.value as T
|
||||
fun <T7> normalValue(ic: IC): T7 = ic.value as T7
|
||||
|
||||
inline class IC(val value: Int) {
|
||||
fun <T> dispatchValue(): T = value as T
|
||||
fun <T8> dispatchValue(): T8 = value as T8
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// IGNORE_BACKEND: JVM
|
||||
// JVM_TARGET: 1.8
|
||||
// LAMBDAS: INDY
|
||||
// CHECK_BYTECODE_LISTING
|
||||
// WITH_SIGNATURES
|
||||
|
||||
fun <T1, R> call(value: T1, f: (T1) -> R): R {
|
||||
return f(value)
|
||||
}
|
||||
|
||||
fun <T2> test(x: T2) = call(x) { it }
|
||||
|
||||
fun box() = test("OK")
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
@kotlin.Metadata
|
||||
public final class<null> GenericLambdaSignatureKt {
|
||||
// source: 'genericLambdaSignature.kt'
|
||||
public final static <<T1:Ljava/lang/Object;R:Ljava/lang/Object;>(TT1;Lkotlin/jvm/functions/Function1<-TT1;+TR;>;)TR;> method call(p0: java.lang.Object, @org.jetbrains.annotations.NotNull p1: kotlin.jvm.functions.Function1): java.lang.Object
|
||||
public final static <<T2:Ljava/lang/Object;>(TT2;)TT2;> method test(p0: java.lang.Object): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.NotNull <null> method box(): java.lang.String
|
||||
private final static <null> method test$lambda-0(p0: java.lang.Object): java.lang.Object
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// IGNORE_BACKEND: JVM
|
||||
// JVM_TARGET: 1.8
|
||||
// SAM_CONVERSIONS: INDY
|
||||
// CHECK_BYTECODE_LISTING
|
||||
// WITH_SIGNATURES
|
||||
|
||||
fun interface FunIFace<T0, R> {
|
||||
fun call(arg: T0): R
|
||||
}
|
||||
|
||||
fun <T1, R> call(value: T1, f: FunIFace<T1, R>): R {
|
||||
return f.call(value)
|
||||
}
|
||||
|
||||
fun <T2> test(x: T2) = call(x) { it }
|
||||
|
||||
fun box() = test("OK")
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
@kotlin.Metadata
|
||||
public interface<<T0:Ljava/lang/Object;R:Ljava/lang/Object;>Ljava/lang/Object;> FunIFace {
|
||||
// source: 'genericLambdaSignature.kt'
|
||||
public abstract <(TT0;)TR;> method call(p0: java.lang.Object): java.lang.Object
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class<null> GenericLambdaSignatureKt {
|
||||
// source: 'genericLambdaSignature.kt'
|
||||
public final static <<T1:Ljava/lang/Object;R:Ljava/lang/Object;>(TT1;LFunIFace<TT1;TR;>;)TR;> method call(p0: java.lang.Object, @org.jetbrains.annotations.NotNull p1: FunIFace): java.lang.Object
|
||||
public final static <<T2:Ljava/lang/Object;>(TT2;)TT2;> method test(p0: java.lang.Object): java.lang.Object
|
||||
public final static @org.jetbrains.annotations.NotNull <null> method box(): java.lang.String
|
||||
private final static <null> method test$lambda-0(p0: java.lang.Object): java.lang.Object
|
||||
}
|
||||
Reference in New Issue
Block a user