| // IGNORE_BACKEND: JS_IR, NATIVE | |
| // IGNORE_HMPP: JS_IR | |
| // DUMP_IR | |
| // WITH_AND_WITHOUT_PLUGIN | |
| // MODULE: lib | |
| // FILE: p3/foo.kt | |
| package p3; | |
| import org.jetbrains.kotlin.plugin.sandbox.MyInlineable | |
| @MyInlineable | |
| public fun Foo( | |
| text: @MyInlineable () -> Unit, | |
| ) { | |
| text() | |
| } | |
| @MyInlineable | |
| public fun FooReturn( | |
| ) = @MyInlineable {} | |
| // MODULE: main(lib) | |
| // FILE: main.kt | |
| import org.jetbrains.kotlin.plugin.sandbox.MyInlineable | |
| import p3.Foo | |
| import p3.FooReturn | |
| var log = "" | |
| @MyInlineable | |
| public fun Bar() { | |
| Foo( | |
| text = { log += "O" }, // @Inlineable invocations can only happen from the context of a @Inlineable function | |
| ) | |
| FooReturn()() | |
| } | |
| fun box(): String { | |
| Bar() | |
| return log + "K" | |
| } |