TESTS: new inline tests added
This commit is contained in:
@@ -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()
|
||||
}
|
||||
Reference in New Issue
Block a user