FILE: smartcastInByClause.kt public final class A : R|kotlin/Any| { public constructor(path: R|kotlin/String?|, index: R|kotlin/Int|): R|A| { super() } public final val path: R|kotlin/String?| = R|/path| public get(): R|kotlin/String?| public final val index: R|kotlin/Int| = R|/index| public get(): R|kotlin/Int| } public abstract interface Base : R|kotlin/Any| { } public final class Derived : R|Base| { public constructor(index: R|kotlin/Int|): R|Derived| { super() } public final val index: R|kotlin/Int| = R|/index| public get(): R|kotlin/Int| } public final fun test(a: R|A?|): R|Base?| { lval path: R|kotlin/String| = R|/a|?.{ $subj$.R|/A.path| } ?: ^test Null(null) R|/takeInt|(R|/a|.R|/A.index|) ^test object : R|Base| { private constructor(): R|| { super() } private final field $$delegate_0: R|Base| = R|/Derived.Derived|(R|/a|.R|/A.index|) public final val x: R|kotlin/Int| = R|/a|.R|/A.index| public get(): R|kotlin/Int| public final fun foo(): R|kotlin/Unit| { R|/takeInt|(R|/a|.R|/A.index|) } } } public final fun takeInt(x: R|kotlin/Int|): R|kotlin/Unit| { }