== myRun == inline fun myRun(block: () -> Unit) { contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } block() } --------------------- L0: 1 INIT: in: {} out: {} v(block: () -> Unit) INIT: in: {} out: {} magic[FAKE_INITIALIZER](block: () -> Unit) -> INIT: in: {} out: {} w(block|) INIT: in: {} out: {} 2 mark({ contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } block() }) INIT: in: {} out: {} mark({ callsInPlace(block, InvocationKind.EXACTLY_ONCE) }) jmp?(L2) d({ callsInPlace(block, InvocationKind.EXACTLY_ONCE) }) L2 [after local declaration]: r({ callsInPlace(block, InvocationKind.EXACTLY_ONCE) }) -> mark(contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) }) call(contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) }, contract|) -> r(block) -> mark(block()) call(block(), invoke|) -> L1: 1 error: sink: USE: in: {} out: {} ===================== == anonymous_0 == { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } --------------------- L3: 3 INIT: in: {} out: {} 4 mark(callsInPlace(block, InvocationKind.EXACTLY_ONCE)) magic[IMPLICIT_RECEIVER](callsInPlace(block, InvocationKind.EXACTLY_ONCE)) -> r(block) -> mark(InvocationKind.EXACTLY_ONCE) r(EXACTLY_ONCE) -> mark(callsInPlace(block, InvocationKind.EXACTLY_ONCE)) call(callsInPlace(block, InvocationKind.EXACTLY_ONCE), callsInPlace|, , ) -> L4: 3 error: sink: USE: in: {} out: {} ===================== == unknownRun == inline fun unknownRun(block: () -> T): T = block() --------------------- L0: 1 INIT: in: {} out: {} v(block: () -> T) INIT: in: {} out: {} magic[FAKE_INITIALIZER](block: () -> T) -> INIT: in: {} out: {} w(block|) INIT: in: {} out: {} r(block) -> INIT: in: {} out: {} mark(block()) call(block(), invoke|) -> ret(*|) L1 L1: error: sink: USE: in: {} out: {} ===================== == throwIfNotCalled == fun throwIfNotCalled() { val x: Int myRun outer@ { unknownRun { myRun { x = 42 return@outer } } throw java.lang.IllegalArgumentException() } println(x) } --------------------- L0: 1 INIT: in: {} out: {} USE: in: {} out: {} 2 mark({ val x: Int myRun outer@ { unknownRun { myRun { x = 42 return@outer } } throw java.lang.IllegalArgumentException() } println(x) }) v(val x: Int) INIT: in: {} out: {x=D} mark(outer@ { unknownRun { myRun { x = 42 return@outer } } throw java.lang.IllegalArgumentException() }) INIT: in: {x=D} out: {x=D} mark({ unknownRun { myRun { x = 42 return@outer } } throw java.lang.IllegalArgumentException() }) r({ unknownRun { myRun { x = 42 return@outer } } throw java.lang.IllegalArgumentException() }) -> mark(myRun outer@ { unknownRun { myRun { x = 42 return@outer } } throw java.lang.IllegalArgumentException() }) call(myRun outer@ { unknownRun { myRun { x = 42 return@outer } } throw java.lang.IllegalArgumentException() }, myRun|) -> L2 [before inlined declaration]: inlined({ unknownRun { myRun { x = 42 return@outer } } throw java.lang.IllegalArgumentException() }) INIT: in: {x=ID} out: {x=ID} USE: in: {x=ONLY_WRITTEN_NEVER_READ} out: {x=ONLY_WRITTEN_NEVER_READ} L3 [after inlined declaration]: mark(println(<) magic[UNRESOLVED_CALL](println(<|!) -> L1: 1 INIT: in: {} out: {} error: sink: USE: in: {} out: {} ===================== == inlined anonymous_1 == { unknownRun { myRun { x = 42 return@outer } } throw java.lang.IllegalArgumentException() } --------------------- L4: 3 INIT: in: {x=D} out: {x=D} 4 mark(unknownRun { myRun { x = 42 return@outer } } throw java.lang.IllegalArgumentException()) mark({ myRun { x = 42 return@outer } }) jmp?(L6) d({ myRun { x = 42 return@outer } }) INIT: in: {} out: {} USE: in: {x=ONLY_WRITTEN_NEVER_READ} out: {x=ONLY_WRITTEN_NEVER_READ} L6 [after local declaration]: r({ myRun { x = 42 return@outer } }) -> INIT: in: {x=D} out: {x=D} mark(unknownRun { myRun { x = 42 return@outer } }) call(unknownRun { myRun { x = 42 return@outer } }, unknownRun|) -> mark(throw java.lang.IllegalArgumentException()) mark(java.lang.IllegalArgumentException()) mark(IllegalArgumentException()) call(IllegalArgumentException(), ) -> throw (throw java.lang.IllegalArgumentException()|) L5: 3 INIT: in: {x=ID} out: {x=ID} error: INIT: in: {x=D} out: {x=D} sink: INIT: in: {x=I?} out: {x=I?} USE: in: {} out: {} ===================== == anonymous_2 == { myRun { x = 42 return@outer } } --------------------- L7: 5 INIT: in: {x=D} out: {x=D} 6 mark(myRun { x = 42 return@outer }) mark({ x = 42 return@outer }) r({ x = 42 return@outer }) -> mark(myRun { x = 42 return@outer }) call(myRun { x = 42 return@outer }, myRun|) -> L9 [before inlined declaration]: inlined({ x = 42 return@outer }) USE: in: {x=ONLY_WRITTEN_NEVER_READ} out: {x=ONLY_WRITTEN_NEVER_READ} L8: L10 [after inlined declaration]: 5 INIT: in: {} out: {} error: sink: USE: in: {} out: {} ===================== == inlined anonymous_3 == { x = 42 return@outer } --------------------- L11: 7 INIT: in: {x=D} out: {x=D} 8 mark(x = 42 return@outer) r(42) -> USE: in: {x=ONLY_WRITTEN_NEVER_READ} out: {x=ONLY_WRITTEN_NEVER_READ} w(x|) INIT: in: {x=D} out: {x=ID} USE: in: {} out: {x=ONLY_WRITTEN_NEVER_READ} ret L5 INIT: in: {x=ID} out: {x=ID} USE: in: {} out: {} L12: - 7 error: - sink: - =====================