KT-7819 Add test to ensure that lambda capturing this literal can be inlined

This commit is contained in:
Alexey Andreev
2016-04-06 10:52:43 +03:00
parent 05887f45f7
commit 9fd19dd7fd
2 changed files with 27 additions and 0 deletions
@@ -0,0 +1,21 @@
package foo
// CHECK_CONTAINS_NO_CALLS: test
inline fun block(p: () -> Unit) = p()
class A(val x: Int) {
fun test(): Int {
var result: Int = 0
block {
result = x
}
return result
}
}
fun box(): String {
assertEquals(23, A(23).test())
return "OK"
}