Write enclosing method info for transformed objects

This commit is contained in:
Michael Bogdanov
2016-01-08 12:51:42 +03:00
parent 8ab1190082
commit 657b9ff808
20 changed files with 348 additions and 51 deletions
@@ -0,0 +1,21 @@
// NO_CHECK_LAMBDA_INLINING
// FULL_JDK
import test.*
import java.util.*
fun box(): String {
val result = Test().callInline("test")
val method = result.javaClass.getMethod("invoke")
val genericReturnType = method.genericReturnType
if (genericReturnType.toString() != "T") return "fail 1: $genericReturnType"
val method2 = Test::class.java.getMethod("callInline", Any::class.java)
val genericParameterType = method2.genericParameterTypes.firstOrNull()
if (genericParameterType != genericReturnType) return "fail 2: $genericParameterType != $genericReturnType"
return "OK"
}
@@ -0,0 +1,12 @@
package test
open class Test {
inline fun <Y> test(z: () -> () -> Y) = z()
fun <T> callInline(p: T) = test<T> {
{
p
}
}
}