[FIR] Support of ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS diagnostic
^KT-56522 Fixed
This commit is contained in:
committed by
Space Team
parent
f1fef62f76
commit
c418a7a7bf
-22
@@ -1,22 +0,0 @@
|
||||
// MODULE: m1-common
|
||||
// FILE: common.kt
|
||||
|
||||
expect class Ok(x: Int, y: String = "")
|
||||
|
||||
expect class FailX(x: Int, y: String = "")
|
||||
|
||||
expect class FailY(x: Int, y: String = "")
|
||||
|
||||
fun test() {
|
||||
Ok(42)
|
||||
Ok(42, "OK")
|
||||
}
|
||||
|
||||
// MODULE: m2-jvm()()(m1-common)
|
||||
// FILE: jvm.kt
|
||||
|
||||
actual class Ok actual constructor(x: Int, y: String)
|
||||
|
||||
actual class FailX actual constructor(x: Int = 0, y: String)
|
||||
|
||||
actual class FailY actual constructor(x: Int, y: String = "")
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// MODULE: m1-common
|
||||
// FILE: common.kt
|
||||
|
||||
|
||||
-40
@@ -1,40 +0,0 @@
|
||||
// MODULE: m1-common
|
||||
// FILE: common.kt
|
||||
|
||||
expect fun ok(x: Int, y: String = "")
|
||||
|
||||
expect fun failX(x: Int, y: String = "")
|
||||
|
||||
expect fun failY(x: Int, y: String = "")
|
||||
|
||||
expect open class Foo {
|
||||
fun ok(x: Int, y: String = "")
|
||||
|
||||
fun failX(x: Int, y: String = "")
|
||||
|
||||
fun failY(x: Int, y: String = "")
|
||||
}
|
||||
|
||||
fun test(foo: Foo) {
|
||||
ok(42)
|
||||
ok(42, "OK")
|
||||
foo.ok(42)
|
||||
foo.ok(42, "OK")
|
||||
}
|
||||
|
||||
// MODULE: m2-jvm()()(m1-common)
|
||||
// FILE: jvm.kt
|
||||
|
||||
actual fun ok(x: Int, y: String) {}
|
||||
|
||||
actual fun failX(x: Int = 0, y: String) {}
|
||||
|
||||
actual fun failY(x: Int, y: String = "") {}
|
||||
|
||||
actual open class Foo {
|
||||
actual fun ok(x: Int, y: String) {}
|
||||
|
||||
actual fun failX(x: Int = 0, y: String) {}
|
||||
|
||||
actual fun failY(x: Int, y: String = "") {}
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// MODULE: m1-common
|
||||
// FILE: common.kt
|
||||
|
||||
|
||||
+3
-3
@@ -29,8 +29,8 @@ fun test(foo: Foo, bar: Bar) {
|
||||
|
||||
actual class Bar : Foo {
|
||||
actual override fun ok(x: Int, y: String) {}
|
||||
|
||||
actual override fun failX(x: Int = 0, y: String) {}
|
||||
|
||||
actual override fun failY(x: Int, y: String = "") {}
|
||||
actual override fun failX(<!ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS!>x: Int = 0<!>, y: String) {}
|
||||
|
||||
actual override fun failY(x: Int, <!ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS!>y: String = ""<!>) {}
|
||||
}
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ fun test(foo: Foo, bar: Bar) {
|
||||
|
||||
actual class Bar : Foo {
|
||||
actual override fun ok(x: Int, y: String) {}
|
||||
|
||||
|
||||
actual override fun failX(<!ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS!>x: Int = <!DEFAULT_VALUE_NOT_ALLOWED_IN_OVERRIDE!>0<!><!>, y: String) {}
|
||||
|
||||
actual override fun failY(x: Int, <!ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS!>y: String = <!DEFAULT_VALUE_NOT_ALLOWED_IN_OVERRIDE!>""<!><!>) {}
|
||||
|
||||
Reference in New Issue
Block a user