generate more correct bytecode for casting Unit to other types
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
fun println(s: String) {
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
println(":Hi!") as Any
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
fun box() = if (4 as? Unit != null) "Fail" else "OK"
|
||||
@@ -0,0 +1,6 @@
|
||||
val foo: () -> Unit = {}
|
||||
|
||||
fun box(): String {
|
||||
foo() as Unit
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user