Files
kotlin-fork/js/js.translator/testData/box/export/overriddenExternalMethodWithSameNameMethod.kt
T
2021-02-12 16:21:09 +03:00

39 lines
706 B
Kotlin
Vendored

// EXPECTED_REACHABLE_NODES: 1252
// IGNORE_BACKEND: JS
// RUN_PLAIN_BOX_FUNCTION
// INFER_MAIN_MODULE
// MODULE: overriden-external-method-with-same-name-method
// FILE: lib.kt
external abstract class Foo {
abstract fun o(): String
}
abstract class Bar : Foo() {
abstract fun String.o(): String
override fun o(): String {
return "O".o()
}
}
@JsExport
class Baz : Bar() {
override fun String.o(): String {
return this
}
}
// FILE: test.js
function Foo() {}
Foo.prototype.k = function() {
return "K"
}
function box() {
return test(new this["overriden-external-method-with-same-name-method"].Baz());
}
function test(foo) {
return foo.o() + foo.k()
}