Suppot inlining default methods, inlining function into its default.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import test.*
|
||||
|
||||
fun testCompilation(): String {
|
||||
emptyFun()
|
||||
emptyFun("K")
|
||||
|
||||
return "OK"
|
||||
}
|
||||
|
||||
fun simple(): String {
|
||||
return simpleFun() + simpleFun("K")
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
var result = testCompilation()
|
||||
if (result != "OK") return "fail1: ${result}"
|
||||
|
||||
result = simple()
|
||||
if (result != "OK") return "fail2: ${result}"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package test
|
||||
|
||||
inline fun emptyFun(arg: String = "O") {
|
||||
|
||||
}
|
||||
|
||||
inline fun simpleFun(arg: String = "O"): String {
|
||||
val r = arg;
|
||||
return r;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user