FIR2IR: cache functions and their parents properly

This commit is contained in:
Mikhail Glukhikh
2020-03-03 19:26:15 +03:00
parent 940567b8bd
commit 0fee8a6946
31 changed files with 71 additions and 121 deletions
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// KJS_WITH_FULL_RUNTIME
// WITH_RUNTIME
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
class Point(val x : Int, val y : Int)
fun box() : String {
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
class A {
fun foo() {}
fun bar(f: A.() -> Unit = {}) {}
@@ -1,5 +1,4 @@
// !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: NATIVE
import kotlin.contracts.*
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun zap(s: String) = s
inline fun tryZap(s1: String, s2: String, fn: String.(String) -> String) =
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun zap(s: String) = s
inline fun tryZap(string: String, fn: String.() -> String) =
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun test1(f: (Int) -> Int) = f(1)
fun test2(f: Int.() -> Int) = 2.f()
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun test(cl: Int.() -> Int):Int = 11.cl()
class Foo {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS, NATIVE
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun box() : String {
val y = 12
val op = { x:Int -> (x + y).toString() }
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
// FULL_JDK
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun box(): String {
val f = fun (s: String): String = s
val g = f as String.() -> String
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
//KT-3450 get and invoke are not parsed in one expression
public class A(val s: String) {
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
class Data
fun newInit(f: Data.() -> Data) = Data().f()
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
class Comment() {
var article = ""
}
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun Any.with(operation : Any.() -> Any) = operation().toString()
val f = { a : Int -> }
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
object ExtProvider {
-1
View File
@@ -1,6 +1,5 @@
// !LANGUAGE: +NewInference
// !USE_EXPERIMENTAL: kotlin.Experimental
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
// ISSUE: KT-35684
-1
View File
@@ -1,7 +1,6 @@
// !LANGUAGE: +NewInference
// WITH_RUNTIME
// KJS_WITH_FULL_RUNTIME
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_REFLECT
import kotlin.experimental.ExperimentalTypeInference
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
// WITH_RUNTIME
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
class A(val result: String)
fun a(body: A.() -> String): String {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// KJS_WITH_FULL_RUNTIME
// WITH_RUNTIME
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// FILE: Outer.kt
package another
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun f(b : Int.(Int)->Int) = 1?.b(1)
fun box(): String {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun f(b : Long.(Long)->Long) = 1L?.b(2L)
fun box(): String {