== myRun == inline fun myRun(block: () -> Unit) { contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } 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() : * NEW: call(block(), invoke|) -> { contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } 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: () -> T): T = block() --------------------- : {<: () -> T} NEW: magic[FAKE_INITIALIZER](block: () -> T) -> block : {<: () -> T} NEW: r(block) -> block() : {<: T} NEW: call(block(), invoke|) -> ===================== == throwIfNotCalled == fun throwIfNotCalled() { val x: Int myRun outer@ { unknownRun { myRun { x = 42 return@outer } } throw java.lang.IllegalArgumentException() } println(x) } --------------------- { unknownRun { myRun { x = 42 return@outer } } throw java.lang.IllegalArgumentException() } : {<: () -> Unit} NEW: r({ unknownRun { myRun { x = 42 return@outer } } throw java.lang.IllegalArgumentException() }) -> outer@ { unknownRun { myRun { x = 42 return@outer } } throw java.lang.IllegalArgumentException() } : {<: () -> Unit} COPY myRun outer@ { unknownRun { myRun { x = 42 return@outer } } throw java.lang.IllegalArgumentException() } : * NEW: call(myRun outer@ { unknownRun { myRun { x = 42 return@outer } } throw java.lang.IllegalArgumentException() }, myRun|) -> println !: * println(< : * NEW: magic[UNRESOLVED_CALL](println(<|!) -> { val x: Int myRun outer@ { unknownRun { myRun { x = 42 return@outer } } throw java.lang.IllegalArgumentException() } println(x) } : * COPY ===================== == inlined anonymous_1 == { unknownRun { myRun { x = 42 return@outer } } throw java.lang.IllegalArgumentException() } --------------------- { myRun { x = 42 return@outer } } : {<: () -> Unit} NEW: r({ myRun { x = 42 return@outer } }) -> unknownRun { myRun { x = 42 return@outer } } : * NEW: call(unknownRun { myRun { x = 42 return@outer } }, unknownRun|) -> IllegalArgumentException() : {<: Throwable} NEW: call(IllegalArgumentException(), ) -> java.lang.IllegalArgumentException() : {<: Throwable} COPY throw java.lang.IllegalArgumentException() !: * unknownRun { myRun { x = 42 return@outer } } throw java.lang.IllegalArgumentException() !: * COPY ===================== == anonymous_2 == { myRun { x = 42 return@outer } } --------------------- { x = 42 return@outer } : {<: () -> Unit} NEW: r({ x = 42 return@outer }) -> myRun { x = 42 return@outer } : * NEW: call(myRun { x = 42 return@outer }, myRun|) -> myRun { x = 42 return@outer } : * COPY ===================== == inlined anonymous_3 == { x = 42 return@outer } --------------------- 42 : Int NEW: r(42) -> return@outer !: * x = 42 return@outer !: * COPY =====================