[JS FIR] Rework JS_NAME_CLASH diagnostic for constructors
- Fix a false positive JS_NAME_CLASH report on constructors from different classes but with the same JsName. - Allow the same JsName for class constructors and other top-level declarations. This behavior differs from K1, but it is correct since there is no real name clash in the generated JS code. ^KT-64867 Fixed
This commit is contained in:
committed by
Space Team
parent
2708c74d9c
commit
5da4d31d37
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
// FIR_DIFFERENCE
|
||||
// K1 performs a check for legacy JS BE; however, this is not relevant for IR BE because in the generated JS code,
|
||||
// there is no name clash between the constructor with JsName and the other top-level declarations with the same JsName.
|
||||
// Keep K1 as it is, but for K2, implement a more relevant check without the clash.
|
||||
package foo
|
||||
|
||||
class A(val x: String) {
|
||||
@JsName("aa") constructor(x: Int) : this("int $x")
|
||||
}
|
||||
|
||||
fun aa() {}
|
||||
Reference in New Issue
Block a user