Propagate KotlinType into if expression codegen for inline classes

This commit is contained in:
Mikhail Zarechenskiy
2018-06-19 15:57:24 +03:00
parent c8c943e5fe
commit f326fd66be
7 changed files with 46 additions and 2 deletions
@@ -0,0 +1,19 @@
// !LANGUAGE: +InlineClasses
interface Base {
fun result(): Int
}
inline class Inlined(val x: Int) : Base {
override fun result(): Int = x
}
fun foo(b: Boolean): Base {
return if (b) Inlined(0) else Inlined(1)
}
fun box(): String {
if (foo(true).result() != 0) return "Fail 1"
if (foo(false).result() != 1) return "Fail 2"
return "OK"
}