[K2, MPP] Forbid matching actual callable with dynamic return type

to expect callable with non-dynamic return type

^KT-59251 Fixed
This commit is contained in:
Ivan Kochurkin
2023-08-18 15:25:58 +02:00
committed by Space Team
parent 452e67f0e6
commit d9b5d37baf
4 changed files with 43 additions and 4 deletions
@@ -0,0 +1,28 @@
// !DIAGNOSTICS: -UNSUPPORTED
// MODULE: m1-common
// FILE: common.kt
expect class Foo {
constructor(p: Any)
fun f1(s: String): Int
fun f2(s: List<String>?): MutableMap<Boolean?, Foo>
fun <T : Set<Number>> f3(t: T): T?
}
// MODULE: m2-js()()(m1-common)
// FILE: js.kt
// TODO: do not suppress UNSUPPORTED once JS files in multi-platform tests are analyzed with JS analyzer facade
actual class Foo {
actual constructor(p: dynamic) {}
actual fun <!ACTUAL_WITHOUT_EXPECT!>f1<!>(s: dynamic): dynamic = null!!
actual fun f2(s: dynamic): MutableMap<Boolean?, Foo> = null!!
actual fun <T : Set<Number>> <!ACTUAL_WITHOUT_EXPECT!>f3<!>(t: T): dynamic = null!!
}
@@ -1,4 +1,3 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNSUPPORTED
// MODULE: m1-common
// FILE: common.kt