Added some tests on local classes in inline bodies
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
inline fun call(crossinline init: () -> Unit) {
|
||||
return init()
|
||||
}
|
||||
|
||||
inline fun test(): String {
|
||||
var res = "Fail"
|
||||
|
||||
call {
|
||||
object {
|
||||
fun run () {
|
||||
res = "OK"
|
||||
}
|
||||
}.run()
|
||||
}
|
||||
|
||||
return res
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
return test()
|
||||
}
|
||||
Reference in New Issue
Block a user