Don't copy default value parameters for fake overrides

This commit is contained in:
Alexander Gorshenev
2020-07-28 21:46:55 +03:00
parent 2cfd776092
commit 9a717e9ecf
9 changed files with 74 additions and 5 deletions
+21
View File
@@ -0,0 +1,21 @@
// MODULE: lib
// FILE: lib.kt
// KT-40083
open class X {
open fun red(x: Int, y: (() -> Int) = { 31 }): Int {
return x+y()
}
}
class Y: X()
// MODULE: main(lib)
// FILE: main.kt
fun box(): String {
if (Y().red(17) { 23 } != 40) return "FAIL 1"
if (Y().red(29) != 60) return "FAIL 2"
return "OK"
}