diff --git a/compiler/testData/codegen/boxInline/simple/kt28547.kt b/compiler/testData/codegen/boxInline/simple/kt28547.kt index 578689dd41c..6960b6f3663 100644 --- a/compiler/testData/codegen/boxInline/simple/kt28547.kt +++ b/compiler/testData/codegen/boxInline/simple/kt28547.kt @@ -1,18 +1,18 @@ // FILE: 1.kt package test -class C { +class C(val value: T) { var inserting: Boolean = false fun nextSlot(): Any? = null fun startNode(key: Any?) {} fun endNode() {} fun emitNode(node: Any?) {} - fun useNode(): Any? = null + fun useNode(): T = value fun skipValue() {} fun updateValue(value: Any?) {} } -class B(val composer: C, val node: T) { +class B(val composer: C, val node: T) { inline fun bar(value: V, block: T.(V) -> Unit) = with(composer) { if (inserting || nextSlot() != value) { updateValue(value) @@ -21,13 +21,13 @@ class B(val composer: C, val node: T) { } } -class A(val composer: C) { - inline fun foo(key: Any, ctor: () -> T, update: B.() -> Unit) = with(composer) { +class A(val composer: C) { + inline fun foo(key: Any, ctor: () -> T, update: B.() -> Unit) = with(composer) { startNode(key) val node = if (inserting) ctor().also { emitNode(it) } else useNode() as T - B(this, node).update() + B(this, node).update() endNode() } } @@ -36,10 +36,10 @@ class A(val composer: C) { import test.* fun box(): String { - val a = A(C()) + val a = A(C("foo")) val str = "OK" var result = "fail" - a.foo( + a.foo( 123, { "abc" }, {