mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-11 00:21:29 +00:00
Migrate boxInline tests to new multi-file framework
This commit is contained in:
committed by
Alexander Udalov
parent
fa1f7d988e
commit
cc84aabdcf
@@ -0,0 +1,37 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
class A {
|
||||
val param = "start"
|
||||
var result = "fail"
|
||||
var addParam = "_additional_"
|
||||
|
||||
inline fun inlineFun(arg: String, crossinline f: (String) -> Unit) {
|
||||
{
|
||||
f(arg + addParam)
|
||||
}()
|
||||
}
|
||||
|
||||
|
||||
fun box(): String {
|
||||
{
|
||||
inlineFun("2") { a ->
|
||||
{
|
||||
result = param + a
|
||||
}()
|
||||
}
|
||||
}()
|
||||
return if (result == "start2_additional_") "OK" else "fail: $result"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return A().box()
|
||||
}
|
||||
Reference in New Issue
Block a user