== fn == fun fn() : String? = null --------------------- null : {<: String?} NEW: r(null) -> ===================== == let == inline fun T.let(f: (T) -> R): R = f(this) --------------------- : {<: (T) -> R} NEW: magic[FAKE_INITIALIZER](f: (T) -> R) -> f : {<: (T) -> R} NEW: r(f) -> this : {<: T} COPY this : {<: T} NEW: r(this, ) -> f(this) : {<: R} NEW: call(f(this), invoke|, ) -> ===================== == foo == fun foo(): String { val x = fn()?.let { throw Exception() } ?: "unreachable?" return x } --------------------- fn() : String NEW: call(fn(), fn) -> { throw Exception() } : {<: (String) -> Nothing} NEW: r({ throw Exception() }) -> let { throw Exception() } !: * fn()?.let { throw Exception() } !: * COPY "unreachable?" : String NEW: r("unreachable?") -> fn()?.let { throw Exception() } ?: "unreachable?" : String NEW: merge(fn()?.let { throw Exception() } ?: "unreachable?"|!, ) -> x : String NEW: r(x) -> return x !: * { val x = fn()?.let { throw Exception() } ?: "unreachable?" return x } !: * COPY ===================== == anonymous_0 == { throw Exception() } --------------------- Exception() : {<: Throwable} NEW: call(Exception(), ) -> throw Exception() !: * throw Exception() !: * COPY ===================== == bar == fun bar(): String { val x = fn() ?: return "" val y = x?.let { throw Exception() } ?: "unreachable" return y } --------------------- fn() : AND{Boolean, String} NEW: call(fn(), fn) -> "" : String NEW: r("") -> return "" !: * fn() ?: return "" : String NEW: merge(fn() ?: return ""|, !) -> x : String NEW: r(x) -> { throw Exception() } : {<: (String) -> Nothing} NEW: r({ throw Exception() }) -> let { throw Exception() } !: * x?.let { throw Exception() } !: * COPY "unreachable" : String NEW: r("unreachable") -> x?.let { throw Exception() } ?: "unreachable" : String NEW: merge(x?.let { throw Exception() } ?: "unreachable"|!, ) -> y : String NEW: r(y) -> return y !: * { val x = fn() ?: return "" val y = x?.let { throw Exception() } ?: "unreachable" return y } !: * COPY ===================== == anonymous_1 == { throw Exception() } --------------------- Exception() : {<: Throwable} NEW: call(Exception(), ) -> throw Exception() !: * throw Exception() !: * COPY =====================