Migrate boxInline tests to new multi-file framework
This commit is contained in:
committed by
Alexander Udalov
parent
fa1f7d988e
commit
cc84aabdcf
-12
@@ -1,12 +0,0 @@
|
||||
package test
|
||||
|
||||
abstract class A<R> {
|
||||
abstract fun getO() : R
|
||||
|
||||
abstract fun getK() : R
|
||||
}
|
||||
|
||||
|
||||
inline fun <R> doWork(job: ()-> R) : R {
|
||||
return job()
|
||||
}
|
||||
+17
-1
@@ -1,3 +1,20 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
abstract class A<R> {
|
||||
abstract fun getO() : R
|
||||
|
||||
abstract fun getK() : R
|
||||
}
|
||||
|
||||
|
||||
inline fun <R> doWork(job: ()-> R) : R {
|
||||
return job()
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
@@ -26,4 +43,3 @@ fun box() : String {
|
||||
|
||||
return "OK"
|
||||
}
|
||||
|
||||
Vendored
-12
@@ -1,12 +0,0 @@
|
||||
package test
|
||||
|
||||
abstract class A<R>(val param: R) {
|
||||
abstract fun getO() : R
|
||||
|
||||
abstract fun getK() : R
|
||||
}
|
||||
|
||||
|
||||
inline fun <R> doWork(job: ()-> R) : R {
|
||||
return job()
|
||||
}
|
||||
+17
@@ -1,3 +1,20 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
abstract class A<R>(val param: R) {
|
||||
abstract fun getO() : R
|
||||
|
||||
abstract fun getK() : R
|
||||
}
|
||||
|
||||
|
||||
inline fun <R> doWork(job: ()-> R) : R {
|
||||
return job()
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
fun test1(): String {
|
||||
val o = "O"
|
||||
|
||||
val result = doWork ({o}, {"K"}, "GOOD")
|
||||
|
||||
return result.getO() + result.getK() + result.getParam()
|
||||
}
|
||||
|
||||
fun test2() : String {
|
||||
//same names as in object
|
||||
val o1 = "O"
|
||||
val k1 = "K"
|
||||
|
||||
val result = doWorkInConstructor ({o1}, {k1}, "GOOD")
|
||||
|
||||
return result.getO() + result.getK() + result.getParam()
|
||||
}
|
||||
|
||||
fun box() : String {
|
||||
val result1 = test1();
|
||||
if (result1 != "OKGOOD") return "fail1 $result1"
|
||||
|
||||
val result2 = test2();
|
||||
if (result2 != "OKGOOD") return "fail2 $result2"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
+35
@@ -1,3 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
|
||||
@@ -48,3 +50,36 @@ inline fun <R> doWorkInConstructor(crossinline jobO: ()-> R, crossinline jobK: (
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
fun test1(): String {
|
||||
val o = "O"
|
||||
|
||||
val result = doWork ({o}, {"K"}, "GOOD")
|
||||
|
||||
return result.getO() + result.getK() + result.getParam()
|
||||
}
|
||||
|
||||
fun test2() : String {
|
||||
//same names as in object
|
||||
val o1 = "O"
|
||||
val k1 = "K"
|
||||
|
||||
val result = doWorkInConstructor ({o1}, {k1}, "GOOD")
|
||||
|
||||
return result.getO() + result.getK() + result.getParam()
|
||||
}
|
||||
|
||||
fun box() : String {
|
||||
val result1 = test1();
|
||||
if (result1 != "OKGOOD") return "fail1 $result1"
|
||||
|
||||
val result2 = test2();
|
||||
if (result2 != "OKGOOD") return "fail2 $result2"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
compiler/testData/codegen/boxInline/anonymousObject/anonymousObjectOnDeclarationSiteSuperParams.1.kt
Vendored
-30
@@ -1,30 +0,0 @@
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
fun test1(): String {
|
||||
val o = "O"
|
||||
|
||||
val result = doWork ({o}, {"K"}, "11")
|
||||
|
||||
return result.getO() + result.getK() + result.param
|
||||
}
|
||||
|
||||
fun test2() : String {
|
||||
//same names as in object
|
||||
val o1 = "O"
|
||||
val k1 = "K"
|
||||
val param = "11"
|
||||
val result = doWorkInConstructor ({o1}, {k1}, {param})
|
||||
|
||||
return result.getO() + result.getK() + result.param
|
||||
}
|
||||
|
||||
fun box() : String {
|
||||
val result1 = test1();
|
||||
if (result1 != "OK11") return "fail1 $result1"
|
||||
|
||||
val result2 = test2();
|
||||
if (result2 != "OK11") return "fail2 $result2"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
+35
@@ -1,3 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
|
||||
@@ -35,3 +37,36 @@ inline fun <R> doWorkInConstructor(crossinline jobO: ()-> R, crossinline jobK: (
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
fun test1(): String {
|
||||
val o = "O"
|
||||
|
||||
val result = doWork ({o}, {"K"}, "11")
|
||||
|
||||
return result.getO() + result.getK() + result.param
|
||||
}
|
||||
|
||||
fun test2() : String {
|
||||
//same names as in object
|
||||
val o1 = "O"
|
||||
val k1 = "K"
|
||||
val param = "11"
|
||||
val result = doWorkInConstructor ({o1}, {k1}, {param})
|
||||
|
||||
return result.getO() + result.getK() + result.param
|
||||
}
|
||||
|
||||
fun box() : String {
|
||||
val result1 = test1();
|
||||
if (result1 != "OK11") return "fail1 $result1"
|
||||
|
||||
val result2 = test2();
|
||||
if (result2 != "OK11") return "fail2 $result2"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return bar {"OK"} ()
|
||||
}
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
package test
|
||||
|
||||
inline fun bar(crossinline y: () -> String) = {
|
||||
call(y)
|
||||
}
|
||||
|
||||
public inline fun <T> call(f: () -> T): T = f()
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
inline fun bar(crossinline y: () -> String) = {
|
||||
call(y)
|
||||
}
|
||||
|
||||
public inline fun <T> call(f: () -> T): T = f()
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return bar {"OK"} ()
|
||||
}
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return bar {"OK"} ()
|
||||
}
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
package test
|
||||
|
||||
inline fun bar(crossinline y: () -> String) = {
|
||||
{ { call(y) }() }()
|
||||
}
|
||||
|
||||
public inline fun <T> call(f: () -> T): T = f()
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
inline fun bar(crossinline y: () -> String) = {
|
||||
{ { call(y) }() }()
|
||||
}
|
||||
|
||||
public inline fun <T> call(f: () -> T): T = f()
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return bar {"OK"} ()
|
||||
}
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
package test
|
||||
|
||||
inline fun bar(crossinline y: () -> String) = {
|
||||
{ { call(y) }() }()
|
||||
}
|
||||
|
||||
public inline fun <T> call(crossinline f: () -> T): T = {{ f() }()}()
|
||||
+12
@@ -1,3 +1,15 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
inline fun bar(crossinline y: () -> String) = {
|
||||
{ { call(y) }() }()
|
||||
}
|
||||
|
||||
public inline fun <T> call(crossinline f: () -> T): T = {{ f() }()}()
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return bar { "OK" }.run()
|
||||
}
|
||||
+11
@@ -1,3 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
internal interface A<T> {
|
||||
@@ -15,3 +17,12 @@ public inline fun <T> call(crossinline f: () -> T): T = object : A<T> {
|
||||
return f()
|
||||
}
|
||||
}.run()
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return bar { "OK" }.run()
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
//KT-7490
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return Entity("OK").directed().calc().value
|
||||
}
|
||||
+12
@@ -1,3 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
open class Entity(val value: String)
|
||||
@@ -16,3 +18,13 @@ inline fun<reified Self : Entity> Self.directed(): Task<Self> =
|
||||
override fun calc(): Self = this@directed
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
//KT-7490
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return Entity("OK").directed().calc().value
|
||||
}
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return A().doSomething().run()
|
||||
}
|
||||
+10
@@ -1,3 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
interface Run {
|
||||
@@ -11,3 +13,11 @@ internal class A {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return A().doSomething().run()
|
||||
}
|
||||
Vendored
-5
@@ -1,5 +0,0 @@
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return A().doSomething()
|
||||
}
|
||||
+10
@@ -1,3 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
internal class A {
|
||||
@@ -7,3 +9,11 @@ internal class A {
|
||||
}()
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return A().doSomething()
|
||||
}
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return A().doSomething("OK")
|
||||
}
|
||||
+10
@@ -1,3 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
internal class A {
|
||||
@@ -7,3 +9,11 @@ internal class A {
|
||||
}()
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return A().doSomething("OK")
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return switch(X.A) + switch(X.B)
|
||||
}
|
||||
+10
@@ -1,3 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
public enum class X { A, B }
|
||||
@@ -6,3 +8,11 @@ public inline fun switch(x: X): String = when (x) {
|
||||
X.A -> "O"
|
||||
X.B -> "K"
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return switch(X.A) + switch(X.B)
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
package test
|
||||
|
||||
public inline fun <T, R> T.myLet(f: (T) -> R): R = f(this)
|
||||
+8
@@ -1,3 +1,11 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
public inline fun <T, R> T.myLet(f: (T) -> R): R = f(this)
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
interface foo {
|
||||
@@ -1,9 +0,0 @@
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
|
||||
val test = Test("OK")
|
||||
|
||||
return test._parameter.property
|
||||
}
|
||||
+14
@@ -1,3 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
class Test(val _member: String) {
|
||||
@@ -15,3 +17,15 @@ interface Z {
|
||||
inline fun test(s: () -> Z): Z {
|
||||
return s()
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
|
||||
val test = Test("OK")
|
||||
|
||||
return test._parameter.property
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
|
||||
val test = Test("OK")
|
||||
|
||||
return test._parameter.property.property
|
||||
}
|
||||
+14
@@ -1,3 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
class Test(val _member: String) {
|
||||
@@ -19,3 +21,15 @@ interface Z<T> {
|
||||
inline fun <T> test(s: () -> Z<T>): Z<T> {
|
||||
return s()
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
|
||||
val test = Test("OK")
|
||||
|
||||
return test._parameter.property.property
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package test
|
||||
|
||||
|
||||
|
||||
inline fun inlineFun(p: () -> Unit) {
|
||||
p()
|
||||
}
|
||||
+12
@@ -1,3 +1,15 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
|
||||
|
||||
inline fun inlineFun(p: () -> Unit) {
|
||||
p()
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
public fun box(): String {
|
||||
@@ -1,10 +0,0 @@
|
||||
package test
|
||||
|
||||
fun <T> T.noInline(p: (T) -> Unit) {
|
||||
p(this)
|
||||
}
|
||||
|
||||
inline fun inlineCall(p: () -> Unit) {
|
||||
p()
|
||||
}
|
||||
|
||||
+14
@@ -1,3 +1,17 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
fun <T> T.noInline(p: (T) -> Unit) {
|
||||
p(this)
|
||||
}
|
||||
|
||||
inline fun inlineCall(p: () -> Unit) {
|
||||
p()
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
@@ -1,6 +0,0 @@
|
||||
package test
|
||||
|
||||
inline fun inlineCall(p: () -> Unit) {
|
||||
p()
|
||||
}
|
||||
|
||||
+10
@@ -1,3 +1,13 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
inline fun inlineCall(p: () -> Unit) {
|
||||
p()
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
var result = "fail"
|
||||
test { it -> result = it }
|
||||
return result
|
||||
}
|
||||
+11
@@ -1,3 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
interface A {
|
||||
@@ -16,3 +18,12 @@ inline fun test(crossinline f: (String) -> Unit) {
|
||||
testNested { it -> { f(it) }()}
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
var result = "fail"
|
||||
test { it -> result = it }
|
||||
return result
|
||||
}
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
package test
|
||||
|
||||
inline fun <T> inlineFun(arg: T, f: (T) -> Unit) {
|
||||
f(arg)
|
||||
}
|
||||
+10
@@ -1,3 +1,13 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
inline fun <T> inlineFun(arg: T, f: (T) -> Unit) {
|
||||
f(arg)
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
Vendored
-7
@@ -1,7 +0,0 @@
|
||||
package test
|
||||
|
||||
inline fun <T> inlineFun(arg: T, crossinline f: (T) -> Unit) {
|
||||
{
|
||||
f(arg)
|
||||
}()
|
||||
}
|
||||
+12
@@ -1,3 +1,15 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
inline fun <T> inlineFun(arg: T, crossinline f: (T) -> Unit) {
|
||||
{
|
||||
f(arg)
|
||||
}()
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
package test
|
||||
|
||||
inline fun <T> inlineFun(arg: T, crossinline f: (T) -> Unit) {
|
||||
{
|
||||
f(arg)
|
||||
}()
|
||||
}
|
||||
+12
@@ -1,3 +1,15 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
inline fun <T> inlineFun(arg: T, crossinline f: (T) -> Unit) {
|
||||
{
|
||||
f(arg)
|
||||
}()
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
package test
|
||||
|
||||
inline fun <T> inlineFun(arg: T, crossinline f: (T) -> Unit) {
|
||||
{
|
||||
f(arg)
|
||||
}()
|
||||
}
|
||||
+12
@@ -1,3 +1,15 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
inline fun <T> inlineFun(arg: T, crossinline f: (T) -> Unit) {
|
||||
{
|
||||
f(arg)
|
||||
}()
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
var result = "fail"
|
||||
test { it -> result = it }
|
||||
return result
|
||||
}
|
||||
+11
@@ -1,3 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
interface A {
|
||||
@@ -16,3 +18,12 @@ fun test(f: (String) -> Unit) {
|
||||
testNested { it -> { f(it) }()}
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
var result = "fail"
|
||||
test { it -> result = it }
|
||||
return result
|
||||
}
|
||||
Vendored
-7
@@ -1,7 +0,0 @@
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
var result = "fail"
|
||||
B("O", "K").test { it -> result = it }
|
||||
return result
|
||||
}
|
||||
+12
@@ -1,3 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
interface A {
|
||||
@@ -20,3 +22,13 @@ class B(val o: String, val k: String) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
var result = "fail"
|
||||
B("O", "K").test { it -> result = it }
|
||||
return result
|
||||
}
|
||||
Vendored
-6
@@ -1,6 +0,0 @@
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return A().box()
|
||||
}
|
||||
+11
@@ -1,3 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
class A {
|
||||
@@ -28,3 +30,12 @@ class A {
|
||||
return if (result == "start1_additional_2_additional_") "OK" else "fail: $result"
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return A().box()
|
||||
}
|
||||
Vendored
-6
@@ -1,6 +0,0 @@
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return A().box()
|
||||
}
|
||||
+11
@@ -1,3 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
class A {
|
||||
@@ -26,3 +28,12 @@ class A {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return A().box()
|
||||
}
|
||||
Vendored
-6
@@ -1,6 +0,0 @@
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return A().box()
|
||||
}
|
||||
+11
@@ -1,3 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
class A {
|
||||
@@ -22,3 +24,12 @@ class A {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return A().box()
|
||||
}
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return A().box()
|
||||
}
|
||||
+11
@@ -1,3 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
class A {
|
||||
@@ -24,3 +26,12 @@ class A {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return A().box()
|
||||
}
|
||||
Vendored
-6
@@ -1,6 +0,0 @@
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return A().box()
|
||||
}
|
||||
+11
@@ -1,3 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
class A {
|
||||
@@ -27,3 +29,12 @@ class A {
|
||||
return if (result == "start1_additional_2_additional_") "OK" else "fail: $result"
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return A().box()
|
||||
}
|
||||
Vendored
-6
@@ -1,6 +0,0 @@
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return A().box()
|
||||
}
|
||||
+11
@@ -1,3 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
class A {
|
||||
@@ -27,3 +29,12 @@ class A {
|
||||
|
||||
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return A().box()
|
||||
}
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
var result = "fail"
|
||||
B("O", "fail").test { it -> result = it }
|
||||
return result
|
||||
}
|
||||
+12
@@ -1,3 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
interface A {
|
||||
@@ -19,3 +21,13 @@ class B(val o: String, val k: String) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
var result = "fail"
|
||||
B("O", "fail").test { it -> result = it }
|
||||
return result
|
||||
}
|
||||
Vendored
-8
@@ -1,8 +0,0 @@
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
var result = "fail"
|
||||
B("O", "K").test { it -> result = it }
|
||||
return result
|
||||
}
|
||||
+13
@@ -1,3 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
interface A {
|
||||
@@ -20,3 +22,14 @@ class B(val o: String, val k: String) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
var result = "fail"
|
||||
B("O", "K").test { it -> result = it }
|
||||
return result
|
||||
}
|
||||
Vendored
-7
@@ -1,7 +0,0 @@
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
var result = ""
|
||||
B("O", "K").test { it -> result += it }
|
||||
return if (result == "OOKK") "OK" else "fail: $result"
|
||||
}
|
||||
+12
@@ -1,3 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
interface A {
|
||||
@@ -20,3 +22,13 @@ class B(val o: String, val k: String) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
var result = ""
|
||||
B("O", "K").test { it -> result += it }
|
||||
return if (result == "OOKK") "OK" else "fail: $result"
|
||||
}
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
var result = ""
|
||||
B("O", "K").test { it -> result += it }
|
||||
return if (result == "OOKK") "OK" else "fail: $result"
|
||||
}
|
||||
+12
@@ -1,3 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
interface A {
|
||||
@@ -29,3 +31,13 @@ class B(val o: String, val k: String) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
var result = ""
|
||||
B("O", "K").test { it -> result += it }
|
||||
return if (result == "OOKK") "OK" else "fail: $result"
|
||||
}
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
var result = ""
|
||||
B("O", "K").test { it -> result += it }
|
||||
return if (result == "startOOKK") "OK" else "fail: $result"
|
||||
}
|
||||
+12
@@ -1,3 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
interface A {
|
||||
@@ -30,3 +32,13 @@ class B(val o: String, val k: String) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
var result = ""
|
||||
B("O", "K").test { it -> result += it }
|
||||
return if (result == "startOOKK") "OK" else "fail: $result"
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
var result = "fail"
|
||||
W("OK").safe {
|
||||
result = this as String
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package test
|
||||
|
||||
class W(val value: Any)
|
||||
|
||||
inline fun W.safe(crossinline body : Any.() -> Unit) {
|
||||
{
|
||||
this.value?.body()
|
||||
}()
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
class W(val value: Any)
|
||||
|
||||
inline fun W.safe(crossinline body : Any.() -> Unit) {
|
||||
{
|
||||
this.value?.body()
|
||||
}()
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
var result = "fail"
|
||||
W("OK").safe {
|
||||
result = this as String
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
var result = "fail"
|
||||
W("OK").safe {
|
||||
{
|
||||
result = this as String
|
||||
}()
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package test
|
||||
|
||||
class W(val value: Any)
|
||||
|
||||
inline fun W.safe(crossinline body : Any.() -> Unit) {
|
||||
{
|
||||
this.value?.body()
|
||||
}()
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
class W(val value: Any)
|
||||
|
||||
inline fun W.safe(crossinline body : Any.() -> Unit) {
|
||||
{
|
||||
this.value?.body()
|
||||
}()
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
var result = "fail"
|
||||
W("OK").safe {
|
||||
{
|
||||
result = this as String
|
||||
}()
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return A().testCall()
|
||||
}
|
||||
+11
@@ -1,3 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
class A {
|
||||
@@ -18,3 +20,12 @@ class A {
|
||||
}()
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return A().testCall()
|
||||
}
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return Person("OK").sayName()
|
||||
}
|
||||
+10
@@ -1,3 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
class Person(val name: String) {
|
||||
@@ -13,3 +15,11 @@ class Person(val name: String) {
|
||||
inline fun nestedSayName2(call: () -> String) = call()
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return Person("OK").sayName()
|
||||
}
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
val res = Person("OK").sayName()
|
||||
if (res != "OKsubOK") return "fail: $res"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
+14
@@ -1,3 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
class Person(val name: String) {
|
||||
@@ -12,3 +14,15 @@ class Person(val name: String) {
|
||||
|
||||
inline fun nestedSayName2(call: () -> String) = name + call()
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
val res = Person("OK").sayName()
|
||||
if (res != "OKsubOK") return "fail: $res"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return Company("OK").sayName()
|
||||
}
|
||||
+11
@@ -1,3 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
class Company(val name: String) {
|
||||
@@ -15,3 +17,12 @@ class Person(val name: String) {
|
||||
fun companyName(call: () -> String) = call()
|
||||
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return Company("OK").sayName()
|
||||
}
|
||||
Vendored
-6
@@ -1,6 +0,0 @@
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return Person("OK").sayName()
|
||||
}
|
||||
+10
@@ -1,3 +1,5 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
fun Person.sayName() = doSayName { name }
|
||||
@@ -12,3 +14,11 @@ inline fun Person.parsonName(call: () -> String) = call()
|
||||
|
||||
fun Person.companyName(call: () -> String) = call()
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return Person("OK").sayName()
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package test
|
||||
|
||||
inline fun test(a: Int, b: Long, crossinline c: () -> String): String {
|
||||
return { "${a}_${b}_${c()}"} ()
|
||||
}
|
||||
+10
@@ -1,3 +1,13 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
inline fun test(a: Int, b: Long, crossinline c: () -> String): String {
|
||||
return { "${a}_${b}_${c()}"} ()
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
@@ -1,6 +0,0 @@
|
||||
package test
|
||||
|
||||
inline fun Double.test(a: Int, b: Long, crossinline c: () -> String): String {
|
||||
|
||||
return { "${this}_${a}_${b}_${c()}"} ()
|
||||
}
|
||||
+11
@@ -1,3 +1,14 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
inline fun Double.test(a: Int, b: Long, crossinline c: () -> String): String {
|
||||
|
||||
return { "${this}_${a}_${b}_${c()}"} ()
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
@@ -1,5 +0,0 @@
|
||||
package test
|
||||
|
||||
inline fun Double.test(a: Int, b: Long, c: () -> String): String {
|
||||
return "${this}_${a}_${b}_${c()}"
|
||||
}
|
||||
+10
@@ -1,3 +1,13 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
inline fun Double.test(a: Int, b: Long, c: () -> String): String {
|
||||
return "${this}_${a}_${b}_${c()}"
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
@@ -1,7 +0,0 @@
|
||||
package test
|
||||
|
||||
class Z {
|
||||
inline fun Double.test(a: Int, b: Long, c: () -> String): String {
|
||||
return "${this}_${a}_${b}_${c()}"
|
||||
}
|
||||
}
|
||||
+12
@@ -1,3 +1,15 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
class Z {
|
||||
inline fun Double.test(a: Int, b: Long, c: () -> String): String {
|
||||
return "${this}_${a}_${b}_${c()}"
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user