TESTS: new inline tests added

This commit is contained in:
Konstantin Anisimov
2017-01-19 11:40:18 +07:00
parent ae49bd8432
commit 9e3fe3a41c
2 changed files with 31 additions and 0 deletions
@@ -0,0 +1,16 @@
// @Suppress("NOTHING_TO_INLINE")
fun foo(i4: Int, i5: Int): Int {
try {
return i4 / i5
} catch (e: Exception) {
return i4
}
}
fun bar(i1: Int, i2: Int, i3: Int): Int {
return i1 + foo(i2, i3)
}
fun main(args: Array<String>) {
println(bar(1, 8, 0).toString())
}
@@ -0,0 +1,15 @@
//@Suppress("NOTHING_TO_INLINE")
//inline fun foo(body: () -> Unit) {
fun foo(body: () -> Unit) {
body()
}
fun bar() {
foo {
println("hello")
}
}
fun main(args: Array<String>) {
bar()
}