TESTS: new tests added

This commit is contained in:
Konstantin Anisimov
2017-01-20 15:46:55 +07:00
parent 9e3fe3a41c
commit 02e604cc71
3 changed files with 32 additions and 4 deletions
@@ -1,12 +1,14 @@
//@Suppress("NOTHING_TO_INLINE")
//inline fun foo(body: () -> Unit) {
fun foo(body: () -> Unit) {
@Suppress("NOTHING_TO_INLINE")
inline fun foo(body: () -> Unit) {
println("hello1")
body()
println("hello4")
}
fun bar() {
foo {
println("hello")
println("hello2")
println("hello3")
}
}
@@ -0,0 +1,14 @@
@Suppress("NOTHING_TO_INLINE")
inline fun foo(vararg args: Int) {
for (a in args) {
println(a.toString())
}
}
fun bar() {
foo(1, 2, 3)
}
fun main(args: Array<String>) {
bar()
}
@@ -0,0 +1,12 @@
@Suppress("NOTHING_TO_INLINE")
inline fun foo(i3: Int, i4: Int) : Int {
return i3 + i3 + i4
}
fun bar(i1: Int, i2: Int) : Int {
return foo(i1 + i2, 2)
}
fun main(args: Array<String>) {
println(bar(1, 2).toString())
}