rra/ilgonmic/export-call-site

[JS IR] Add test with exported overridden property from interface

[JS IR] Accessors should not be exported when overridden from non-exported interface

Merge-request: KT-MR-6166
Merged-by: Ilya Goncharov <Ilya.Goncharov@jetbrains.com>

^KT-52144 fixed
This commit is contained in:
Ilya Goncharov
2022-04-29 12:13:09 +00:00
committed by Space
parent cdb5845693
commit 1fc7fbed79
4 changed files with 77 additions and 34 deletions
@@ -0,0 +1,30 @@
// TARGET_BACKEND: JS_IR
interface Foo {
val foo: String
val foo2: String
var foo3: String
}
@JsExport
class Bar : Foo {
override val foo: String
get() = "foo"
override val foo2: String = "foo2"
override var foo3: String = "foo3"
}
fun box(): String {
val bar = Bar()
if (bar.foo != "foo") return "fail 1"
if (bar.foo2 != "foo2") return "fail 2"
if (bar.foo3 != "foo3") return "fail 3"
bar.foo3 = "foo4"
if (bar.foo3 != "foo4") return "fail 4"
return "OK"
}