[JS IR] Fix name clash between class members defined on prototype

- Fixes [KT-33327]
This commit is contained in:
Roman Artemev
2019-11-21 11:20:50 +03:00
committed by romanart
parent 987c6ab3ee
commit 9946feb66c
7 changed files with 53 additions and 11 deletions
@@ -1,6 +1,3 @@
// Name clashes
// IGNORE_BACKEND: JS_IR
// EXPECTED_REACHABLE_NODES: 1295
package foo
@@ -0,0 +1,27 @@
// EXPECTED_REACHABLE_NODES: 1284
// KT-33327
class C {
var foo: String = "FAIL1"
fun foo(foo: String): C {
this.foo = foo
return this
}
@JsName("_bar")
var bar: String = "FAIL2"
fun bar(bar: String): C {
this.bar = bar
return this
}
}
fun box(): String {
val c = C()
c.foo("O").bar("K")
return c.foo + c.bar
}