Primitive support for LocalVariables for function parameters

This commit is contained in:
Denis Vnukov
2018-08-07 08:25:57 -07:00
committed by Mikhael Bogdanov
parent 1a56af9bb0
commit 65c79ecfe9
21 changed files with 293 additions and 26 deletions
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
data class A(val x: String, val y: Int)
fun foo(a: A, block: (A) -> String): String = block(a)
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
data class Data(val x: String, val y: Int)
suspend fun test() {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
class A<T>(val x: String, val y: String, val z: T)
suspend fun <T> foo(a: A<T>, block: suspend (A<T>) -> String): String = block(a)
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
data class A<T, F>(val x: T, val y: F)
suspend fun <X, Y> foo(a: A<X, Y>, block: suspend (A<X, Y>) -> String) = block(a)
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
data class A(val x: String, val y: String)
suspend inline fun foo(a: A, block: suspend (A) -> String): String = block(a)
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
data class A(val x: String, val y: String)
suspend fun foo(a: A, block: suspend (Int, A, String) -> String): String = block(1, a, "#")
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
class A {
operator fun component1() = "O"
operator fun component2(): String = throw RuntimeException("fail 0")
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
public fun <T> Iterable<T>.myforEach(operation: (T) -> Unit) : Unit {
for (element in this) operation(element)
}
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
fun foo() {
fun bar() : (Int) -> Unit {
return {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
class C {
@kotlin.jvm.JvmOverloads fun foo(firstParam: Int, secondParam: String = "") {
}
+1
View File
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
class A(val value: String)
fun A.test(): String {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
fun foo() {
var a = {
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
fun foo() {
fun bar() {
}
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM_IR
data class A(val x: Double = 1.0, val y: String = "", val z: Char = '0')
fun foo(a: A, block: (A, String, Int) -> String): String = block(a, "", 1)