caa1570e25
The patch fixes the js function signature rules to avoid clashes between bridge and delegated call. Use overridden symbols dfs of JsName annotation in order to get the correct bridge name. ^KT-52968 Fixed
38 lines
1.2 KiB
Kotlin
Vendored
38 lines
1.2 KiB
Kotlin
Vendored
interface TestInterface {
|
|
@JsName("testName")
|
|
fun testFunction(): String
|
|
fun testFunction(x: String): String
|
|
}
|
|
|
|
interface TestInterfaceA : TestInterface {
|
|
override fun testFunction(): String
|
|
override fun testFunction(x: String): String
|
|
}
|
|
|
|
class TestClassA : TestInterfaceA {
|
|
override fun testFunction(): String = "TestClassA"
|
|
override fun testFunction(x: String): String = "TestClassA: $x"
|
|
}
|
|
|
|
fun testTestInterface1(x: TestInterface) = x.testFunction()
|
|
fun testTestInterface2(x: TestInterface) = x.testFunction("OK")
|
|
|
|
fun testTestInterfaceA1(x: TestInterfaceA) = x.testFunction()
|
|
fun testTestInterfaceA2(x: TestInterfaceA) = x.testFunction("OK")
|
|
|
|
fun testTestClassA1(x: TestClassA) = x.testFunction()
|
|
fun testTestClassA2(x: TestClassA) = x.testFunction("OK")
|
|
|
|
fun box(): String {
|
|
assertEquals("TestClassA", testTestInterface1(TestClassA()))
|
|
assertEquals("TestClassA: OK", testTestInterface2(TestClassA()))
|
|
|
|
assertEquals("TestClassA", testTestInterfaceA1(TestClassA()))
|
|
assertEquals("TestClassA: OK", testTestInterfaceA2(TestClassA()))
|
|
|
|
assertEquals("TestClassA", testTestClassA1(TestClassA()))
|
|
assertEquals("TestClassA: OK", testTestClassA2(TestClassA()))
|
|
|
|
return "OK"
|
|
}
|