== myRun == inline fun myRun(block: () -> Unit): Unit { contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } return block() } --------------------- : {<: () -> Unit} NEW: magic[FAKE_INITIALIZER](block: () -> Unit) -> { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } : {<: ContractBuilder.() -> Unit} NEW: r({ callsInPlace(block, InvocationKind.EXACTLY_ONCE) }) -> contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } : * NEW: call(contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) }, contract|) -> block : {<: () -> Unit} NEW: r(block) -> block() : Unit NEW: call(block(), invoke|) -> return block() !: * { contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } return block() } !: * COPY ===================== == anonymous_0 == { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } --------------------- : {<: ContractBuilder} NEW: magic[IMPLICIT_RECEIVER](callsInPlace(block, InvocationKind.EXACTLY_ONCE)) -> block : {<: Function} NEW: r(block) -> EXACTLY_ONCE : {<: InvocationKind} NEW: r(EXACTLY_ONCE) -> InvocationKind.EXACTLY_ONCE : {<: InvocationKind} COPY callsInPlace(block, InvocationKind.EXACTLY_ONCE) : * NEW: call(callsInPlace(block, InvocationKind.EXACTLY_ONCE), callsInPlace|, , ) -> callsInPlace(block, InvocationKind.EXACTLY_ONCE) : * COPY ===================== == unknownRun == inline fun unknownRun(block: () -> Unit) { block() } --------------------- : {<: () -> Unit} NEW: magic[FAKE_INITIALIZER](block: () -> Unit) -> block : {<: () -> Unit} NEW: r(block) -> block() : * NEW: call(block(), invoke|) -> { block() } : * COPY ===================== == foo == fun foo() { val x: Int myRun { unknownRun { println("shouldn't change anything") } x = 42 } println(x) } --------------------- { unknownRun { println("shouldn't change anything") } x = 42 } : {<: () -> Unit} NEW: r({ unknownRun { println("shouldn't change anything") } x = 42 }) -> myRun { unknownRun { println("shouldn't change anything") } x = 42 } : * NEW: call(myRun { unknownRun { println("shouldn't change anything") } x = 42 }, myRun|) -> x : Int NEW: r(x) -> println(x) : * NEW: call(println(x), println|) -> { val x: Int myRun { unknownRun { println("shouldn't change anything") } x = 42 } println(x) } : * COPY ===================== == inlined anonymous_1 == { unknownRun { println("shouldn't change anything") } x = 42 } --------------------- { println("shouldn't change anything") } : {<: () -> Unit} NEW: r({ println("shouldn't change anything") }) -> unknownRun { println("shouldn't change anything") } : * NEW: call(unknownRun { println("shouldn't change anything") }, unknownRun|) -> 42 : Int NEW: r(42) -> x = 42 !: * unknownRun { println("shouldn't change anything") } x = 42 !: * COPY ===================== == anonymous_2 == { println("shouldn't change anything") } --------------------- "shouldn't change anything" : * NEW: r("shouldn't change anything") -> println("shouldn't change anything") : * NEW: call(println("shouldn't change anything"), println|) -> println("shouldn't change anything") : * COPY =====================