Support crossinline suspend lambda as parameter of inline function
Use fake continuation instead of ALOAD 0 while inlining Do not generate state machine for inner lambdas and inner objects, which capture crossinline suspend lambda. #KT-19159: Fixed
This commit is contained in:
+8
-1
@@ -35,7 +35,11 @@ fun builderConsumer(c: suspend () -> Consumer): Consumer {
|
||||
}
|
||||
|
||||
class Container {
|
||||
var y: String = "FAIL 1"
|
||||
var y: String = "FAIL 0"
|
||||
|
||||
val consumer0 = crossInlineBuilderConsumer { s ->
|
||||
y = s
|
||||
}
|
||||
|
||||
val consumer1 = crossInlineBuilderConsumer { s ->
|
||||
builder {
|
||||
@@ -108,6 +112,9 @@ class Container {
|
||||
|
||||
fun box(): String {
|
||||
val c = Container()
|
||||
c.consumer0.consume("OK")
|
||||
if (c.y != "OK") return c.y
|
||||
c.y = "FAIL 1"
|
||||
c.consumer1.consume("OK")
|
||||
if (c.y != "OK") return c.y
|
||||
c.y = "FAIL 2"
|
||||
|
||||
Reference in New Issue
Block a user