Fix bytecode optimisations for consequent boxing

This commit is contained in:
Mikhail Zarechenskiy
2018-06-18 10:16:24 +03:00
parent 01d9be65bc
commit 246d5e294c
2 changed files with 25 additions and 8 deletions
@@ -6,11 +6,11 @@ fun test() {
val a = Result<Int>(1) // valueOf
val b = Result<String>("sample")
val c = Result<Result<Int>>(a) // box
val d = Result<Result<Int>>(Result<Int>(1)) // valueOf, box
val c = Result<Result<Int>>(a)
val d = Result<Result<Int>>(Result<Int>(1)) // valueOf
}
// 2 INVOKESTATIC Result\$Erased.box
// 0 INVOKESTATIC Result\$Erased.box
// 0 INVOKEVIRTUAL Result.unbox
// 2 valueOf