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