Fix for KT-16581: VerifyError when calling default value parameter with jvm-target 1.8

#KT-16581 Fixed
This commit is contained in:
Mikhael Bogdanov
2017-03-02 13:39:45 +01:00
parent ffe3453937
commit a03ed6f742
5 changed files with 73 additions and 26 deletions
+9
View File
@@ -0,0 +1,9 @@
// JVM_TARGET: 1.8
fun failAtRuntime(numberArg: Number = 0.0): Number {
return numberArg
}
fun box(): String {
failAtRuntime()
return "OK"
}
+17
View File
@@ -0,0 +1,17 @@
// JVM_TARGET: 1.8
fun test(o: Number) {}
fun test2(o: Number) {
val p: Int = 1
val o = if (z < 1) p else o
test(o)
}
var z = 1
fun box(): String {
val x: Number = 1
test2(x)
return "OK"
}
+12
View File
@@ -0,0 +1,12 @@
// JVM_TARGET: 1.8
fun number(doLong: Boolean): Number = when {
doLong -> 1.toLong()
else -> 0
}
fun box(): String {
number(true)
return "OK"
}