diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/noUnsupportedInLocals.kt b/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/noUnsupportedInLocals.kt index 576bc384edc..e5494ad6293 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/noUnsupportedInLocals.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/noUnsupportedInLocals.kt @@ -2,7 +2,7 @@ val foo: dynamic = 1 -fun foo() { +fun bar() { class C { val foo: dynamic = 1 } diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/noUnsupportedInLocals.txt b/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/noUnsupportedInLocals.txt index f332a7d9929..8ebbb7e1736 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/noUnsupportedInLocals.txt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/noUnsupportedInLocals.txt @@ -1,4 +1,4 @@ package public val foo: dynamic = 1 -public fun foo(): kotlin.Unit +public fun bar(): kotlin.Unit diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onNonNativeClassMembers.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onNonNativeClassMembers.kt index 9b6895eb371..19b4f81178b 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onNonNativeClassMembers.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onNonNativeClassMembers.kt @@ -14,7 +14,7 @@ class A { fun Int.invoke(a: String, b: Int) = "OK" @nativeInvoke - val foo = 0 + val baz = 0 @nativeInvoke object Obj {} diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onNonNativeClassMembers.txt b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onNonNativeClassMembers.txt index 7f7ac9ff0ed..c01a4b9f22c 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onNonNativeClassMembers.txt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/nativeInvoke/onNonNativeClassMembers.txt @@ -2,7 +2,7 @@ package public final class A { public constructor A() - @kotlin.js.nativeInvoke() public final val foo: kotlin.Int = 0 + @kotlin.js.nativeInvoke() public final val baz: kotlin.Int = 0 public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean @kotlin.js.nativeInvoke() public final fun foo(): kotlin.Unit public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/js/js.translator/testData/nameClashes/cases/classAndCompanionObjectMembers.kt b/js/js.translator/testData/nameClashes/cases/classAndCompanionObjectMembers.kt new file mode 100644 index 00000000000..f1f57741257 --- /dev/null +++ b/js/js.translator/testData/nameClashes/cases/classAndCompanionObjectMembers.kt @@ -0,0 +1,23 @@ +package foo + +class A { + fun foo() = 23 + + val bar = 123 + + companion object { + fun foo() = 42 + + val bar = 142 + } +} + +fun box(): String { + assertEquals(23, A().foo()) + assertEquals(42, A.foo()) + + assertEquals(123, A().bar) + assertEquals(142, A.bar) + + return "OK" +} \ No newline at end of file