[JS IR] Add JS BE diagnostic tests
Add tests for: - EXPORTING_JS_NAME_CLASH - EXPORTING_JS_NAME_CLASH_ES ^KT-61710
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
// FIR_IDENTICAL
|
||||
// FILE: A.kt
|
||||
@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH")
|
||||
package foo
|
||||
|
||||
<!EXPORTING_JS_NAME_CLASH, EXPORTING_JS_NAME_CLASH_ES!>@JsExport fun test() = 1<!>
|
||||
|
||||
// FILE: B.kt
|
||||
@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH")
|
||||
package foo
|
||||
|
||||
<!EXPORTING_JS_NAME_CLASH, EXPORTING_JS_NAME_CLASH_ES!>@JsExport @JsName("test") fun bar() = 2<!>
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// FIR_IDENTICAL
|
||||
// FILE: A.kt
|
||||
@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH")
|
||||
package foo
|
||||
|
||||
<!EXPORTING_JS_NAME_CLASH, EXPORTING_JS_NAME_CLASH_ES!>@JsExport fun test() = 1<!>
|
||||
|
||||
// FILE: B.kt
|
||||
@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH")
|
||||
package foo
|
||||
|
||||
<!EXPORTING_JS_NAME_CLASH, EXPORTING_JS_NAME_CLASH_ES!>@JsExport @JsName("test") fun bar() = 2<!>
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// FIR_IDENTICAL
|
||||
// FILE: A.kt
|
||||
@file:Suppress("OPT_IN_USAGE")
|
||||
package foo
|
||||
|
||||
<!EXPORTING_JS_NAME_CLASH_ES!>@JsExport fun test() = 1<!>
|
||||
|
||||
// FILE: B.kt
|
||||
@file:Suppress("OPT_IN_USAGE")
|
||||
package foo.bar
|
||||
|
||||
<!EXPORTING_JS_NAME_CLASH_ES!>@JsExport @JsName("test") fun bar() = 2<!>
|
||||
+106
@@ -0,0 +1,106 @@
|
||||
/Function1.kt:7:1: warning: Exporting name 'test' in ES modules may clash with
|
||||
exporting name 'test' from file '/Class1.kt'
|
||||
exporting name 'test' from file '/Property1.kt'
|
||||
|
||||
/Function1.kt:7:1: error: Exporting name 'test' clashes with
|
||||
exporting name 'test' from file '/Class1.kt'
|
||||
package 'foo.bar.baz.test' from file '/Package1.kt'
|
||||
package 'foo.bar.baz.test' from file '/Package2.kt'
|
||||
exporting name 'test' from file '/Property1.kt'
|
||||
|
||||
/Function2.kt:13:1: error: Exporting name 'baz' clashes with
|
||||
package 'foo.bar.baz' from file '/Class1.kt'
|
||||
package 'foo.bar.baz' from file '/Function1.kt'
|
||||
package 'foo.bar.baz' from file '/Package1.kt'
|
||||
package 'foo.bar.baz' from file '/Package2.kt'
|
||||
package 'foo.bar.baz' from file '/Property1.kt'
|
||||
|
||||
/Function3.kt:18:1: warning: Exporting name 'foo' in ES modules may clash with
|
||||
exporting name 'foo' from file '/Class3.kt'
|
||||
exporting name 'foo' from file '/Property3.kt'
|
||||
|
||||
/Function3.kt:18:1: error: Exporting name 'foo' clashes with
|
||||
package 'foo' from file '/Class1.kt'
|
||||
package 'foo' from file '/Class2.kt'
|
||||
exporting name 'foo' from file '/Class3.kt'
|
||||
package 'foo' from file '/Function1.kt'
|
||||
package 'foo' from file '/Function2.kt'
|
||||
package 'foo' from file '/Package1.kt'
|
||||
package 'foo' from file '/Package2.kt'
|
||||
package 'foo' from file '/Property1.kt'
|
||||
package 'foo' from file '/Property2.kt'
|
||||
exporting name 'foo' from file '/Property3.kt'
|
||||
|
||||
/Property1.kt:24:1: warning: Exporting name 'test' in ES modules may clash with
|
||||
exporting name 'test' from file '/Class1.kt'
|
||||
exporting name 'test' from file '/Function1.kt'
|
||||
|
||||
/Property1.kt:24:1: error: Exporting name 'test' clashes with
|
||||
exporting name 'test' from file '/Class1.kt'
|
||||
exporting name 'test' from file '/Function1.kt'
|
||||
package 'foo.bar.baz.test' from file '/Package1.kt'
|
||||
package 'foo.bar.baz.test' from file '/Package2.kt'
|
||||
|
||||
/Property2.kt:30:1: warning: Exporting name 'bar' in ES modules may clash with exporting name 'bar' from file '/Class2.kt'
|
||||
|
||||
/Property2.kt:30:1: error: Exporting name 'bar' clashes with
|
||||
package 'foo.bar' from file '/Class1.kt'
|
||||
exporting name 'bar' from file '/Class2.kt'
|
||||
package 'foo.bar' from file '/Function1.kt'
|
||||
package 'foo.bar' from file '/Function2.kt'
|
||||
package 'foo.bar' from file '/Package1.kt'
|
||||
package 'foo.bar' from file '/Package2.kt'
|
||||
package 'foo.bar' from file '/Property1.kt'
|
||||
|
||||
/Property3.kt:35:1: warning: Exporting name 'foo' in ES modules may clash with
|
||||
exporting name 'foo' from file '/Class3.kt'
|
||||
exporting name 'foo' from file '/Function3.kt'
|
||||
|
||||
/Property3.kt:35:1: error: Exporting name 'foo' clashes with
|
||||
package 'foo' from file '/Class1.kt'
|
||||
package 'foo' from file '/Class2.kt'
|
||||
exporting name 'foo' from file '/Class3.kt'
|
||||
package 'foo' from file '/Function1.kt'
|
||||
package 'foo' from file '/Function2.kt'
|
||||
exporting name 'foo' from file '/Function3.kt'
|
||||
package 'foo' from file '/Package1.kt'
|
||||
package 'foo' from file '/Package2.kt'
|
||||
package 'foo' from file '/Property1.kt'
|
||||
package 'foo' from file '/Property2.kt'
|
||||
|
||||
/Class1.kt:41:1: warning: Exporting name 'test' in ES modules may clash with
|
||||
exporting name 'test' from file '/Function1.kt'
|
||||
exporting name 'test' from file '/Property1.kt'
|
||||
|
||||
/Class1.kt:41:1: error: Exporting name 'test' clashes with
|
||||
exporting name 'test' from file '/Function1.kt'
|
||||
package 'foo.bar.baz.test' from file '/Package1.kt'
|
||||
package 'foo.bar.baz.test' from file '/Package2.kt'
|
||||
exporting name 'test' from file '/Property1.kt'
|
||||
|
||||
/Class2.kt:47:1: warning: Exporting name 'bar' in ES modules may clash with exporting name 'bar' from file '/Property2.kt'
|
||||
|
||||
/Class2.kt:47:1: error: Exporting name 'bar' clashes with
|
||||
package 'foo.bar' from file '/Class1.kt'
|
||||
package 'foo.bar' from file '/Function1.kt'
|
||||
package 'foo.bar' from file '/Function2.kt'
|
||||
package 'foo.bar' from file '/Package1.kt'
|
||||
package 'foo.bar' from file '/Package2.kt'
|
||||
package 'foo.bar' from file '/Property1.kt'
|
||||
exporting name 'bar' from file '/Property2.kt'
|
||||
|
||||
/Class3.kt:51:1: warning: Exporting name 'foo' in ES modules may clash with
|
||||
exporting name 'foo' from file '/Function3.kt'
|
||||
exporting name 'foo' from file '/Property3.kt'
|
||||
|
||||
/Class3.kt:51:1: error: Exporting name 'foo' clashes with
|
||||
package 'foo' from file '/Class1.kt'
|
||||
package 'foo' from file '/Class2.kt'
|
||||
package 'foo' from file '/Function1.kt'
|
||||
package 'foo' from file '/Function2.kt'
|
||||
exporting name 'foo' from file '/Function3.kt'
|
||||
package 'foo' from file '/Package1.kt'
|
||||
package 'foo' from file '/Package2.kt'
|
||||
package 'foo' from file '/Property1.kt'
|
||||
package 'foo' from file '/Property2.kt'
|
||||
exporting name 'foo' from file '/Property3.kt'
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
// FIR_IDENTICAL
|
||||
// !RENDER_ALL_DIAGNOSTICS_FULL_TEXT
|
||||
// FILE: Function1.kt
|
||||
@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH")
|
||||
package foo.bar.baz
|
||||
|
||||
<!EXPORTING_JS_NAME_CLASH, EXPORTING_JS_NAME_CLASH_ES!>@JsExport fun test() = 1<!>
|
||||
|
||||
// FILE: Function2.kt
|
||||
@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH")
|
||||
package foo.bar
|
||||
|
||||
<!EXPORTING_JS_NAME_CLASH!>@JsExport fun baz() = 1<!>
|
||||
|
||||
// FILE: Function3.kt
|
||||
@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH")
|
||||
|
||||
<!EXPORTING_JS_NAME_CLASH, EXPORTING_JS_NAME_CLASH_ES!>@JsExport fun foo() = 1<!>
|
||||
|
||||
// FILE: Property1.kt
|
||||
@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH")
|
||||
package foo.bar.baz
|
||||
|
||||
<!EXPORTING_JS_NAME_CLASH, EXPORTING_JS_NAME_CLASH_ES!>@JsExport @JsName("test") val bar = 2<!>
|
||||
|
||||
// FILE: Property2.kt
|
||||
@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH")
|
||||
package foo
|
||||
|
||||
<!EXPORTING_JS_NAME_CLASH, EXPORTING_JS_NAME_CLASH_ES!>@JsExport val bar = 2<!>
|
||||
|
||||
// FILE: Property3.kt
|
||||
@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH")
|
||||
|
||||
<!EXPORTING_JS_NAME_CLASH, EXPORTING_JS_NAME_CLASH_ES!>@JsExport @JsName("foo") val bar = 3<!>
|
||||
|
||||
// FILE: Class1.kt
|
||||
@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH")
|
||||
package foo.bar.baz
|
||||
|
||||
<!EXPORTING_JS_NAME_CLASH, EXPORTING_JS_NAME_CLASH_ES!>@JsExport @JsName("test") class Class1<!>
|
||||
|
||||
// FILE: Class2.kt
|
||||
@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH")
|
||||
package foo
|
||||
|
||||
<!EXPORTING_JS_NAME_CLASH, EXPORTING_JS_NAME_CLASH_ES!>@JsExport @JsName("bar") class Class2<!>
|
||||
|
||||
// FILE: Class3.kt
|
||||
@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH")
|
||||
<!EXPORTING_JS_NAME_CLASH, EXPORTING_JS_NAME_CLASH_ES!>@JsExport @JsName("foo") class Class3<!>
|
||||
|
||||
// FILE: Package1.kt
|
||||
@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH")
|
||||
package foo.bar.baz.test
|
||||
|
||||
@JsExport val foo1 = 1
|
||||
|
||||
// FILE: Package2.kt
|
||||
@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH")
|
||||
package foo.bar.baz.test.a.b.c
|
||||
|
||||
@JsExport val foo2 = 1
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
/Function1.kt:7:1: warning: Exporting name 'test' in ES modules may clash with
|
||||
exporting name 'test' from file '/Class1.kt'
|
||||
exporting name 'test' from file '/Class2.kt'
|
||||
exporting name 'test' from file '/Function2.kt'
|
||||
exporting name 'test' from file '/Function3.kt'
|
||||
exporting name 'test' from file '/Property1.kt'
|
||||
exporting name 'test' from file '/Property2.kt'
|
||||
|
||||
/Function2.kt:13:1: warning: Exporting name 'test' in ES modules may clash with
|
||||
exporting name 'test' from file '/Class1.kt'
|
||||
exporting name 'test' from file '/Class2.kt'
|
||||
exporting name 'test' from file '/Function1.kt'
|
||||
exporting name 'test' from file '/Function3.kt'
|
||||
exporting name 'test' from file '/Property1.kt'
|
||||
exporting name 'test' from file '/Property2.kt'
|
||||
|
||||
/Function3.kt:18:1: warning: Exporting name 'test' in ES modules may clash with
|
||||
exporting name 'test' from file '/Class1.kt'
|
||||
exporting name 'test' from file '/Class2.kt'
|
||||
exporting name 'test' from file '/Function1.kt'
|
||||
exporting name 'test' from file '/Function2.kt'
|
||||
exporting name 'test' from file '/Property1.kt'
|
||||
exporting name 'test' from file '/Property2.kt'
|
||||
|
||||
/Property1.kt:24:1: warning: Exporting name 'test' in ES modules may clash with
|
||||
exporting name 'test' from file '/Class1.kt'
|
||||
exporting name 'test' from file '/Class2.kt'
|
||||
exporting name 'test' from file '/Function1.kt'
|
||||
exporting name 'test' from file '/Function2.kt'
|
||||
exporting name 'test' from file '/Function3.kt'
|
||||
exporting name 'test' from file '/Property2.kt'
|
||||
|
||||
/Property2.kt:30:1: warning: Exporting name 'test' in ES modules may clash with
|
||||
exporting name 'test' from file '/Class1.kt'
|
||||
exporting name 'test' from file '/Class2.kt'
|
||||
exporting name 'test' from file '/Function1.kt'
|
||||
exporting name 'test' from file '/Function2.kt'
|
||||
exporting name 'test' from file '/Function3.kt'
|
||||
exporting name 'test' from file '/Property1.kt'
|
||||
|
||||
/Class1.kt:36:1: warning: Exporting name 'test' in ES modules may clash with
|
||||
exporting name 'test' from file '/Class2.kt'
|
||||
exporting name 'test' from file '/Function1.kt'
|
||||
exporting name 'test' from file '/Function2.kt'
|
||||
exporting name 'test' from file '/Function3.kt'
|
||||
exporting name 'test' from file '/Property1.kt'
|
||||
exporting name 'test' from file '/Property2.kt'
|
||||
|
||||
/Class2.kt:42:1: warning: Exporting name 'test' in ES modules may clash with
|
||||
exporting name 'test' from file '/Class1.kt'
|
||||
exporting name 'test' from file '/Function1.kt'
|
||||
exporting name 'test' from file '/Function2.kt'
|
||||
exporting name 'test' from file '/Function3.kt'
|
||||
exporting name 'test' from file '/Property1.kt'
|
||||
exporting name 'test' from file '/Property2.kt'
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
// FIR_IDENTICAL
|
||||
// !RENDER_ALL_DIAGNOSTICS_FULL_TEXT
|
||||
// FILE: Function1.kt
|
||||
@file:Suppress("OPT_IN_USAGE")
|
||||
package Function1
|
||||
|
||||
<!EXPORTING_JS_NAME_CLASH_ES!>@JsExport fun test() = 1<!>
|
||||
|
||||
// FILE: Function2.kt
|
||||
@file:Suppress("OPT_IN_USAGE")
|
||||
package Function2
|
||||
|
||||
<!EXPORTING_JS_NAME_CLASH_ES!>@JsExport fun test() = 1<!>
|
||||
|
||||
// FILE: Function3.kt
|
||||
@file:Suppress("OPT_IN_USAGE")
|
||||
|
||||
<!EXPORTING_JS_NAME_CLASH_ES!>@JsExport fun test() = 1<!>
|
||||
|
||||
// FILE: Property1.kt
|
||||
@file:Suppress("OPT_IN_USAGE")
|
||||
package Property1
|
||||
|
||||
<!EXPORTING_JS_NAME_CLASH_ES!>@JsExport val test = 1<!>
|
||||
|
||||
// FILE: Property2.kt
|
||||
@file:Suppress("OPT_IN_USAGE")
|
||||
package Property2
|
||||
|
||||
<!EXPORTING_JS_NAME_CLASH_ES!>@JsExport val test = 1<!>
|
||||
|
||||
// FILE: Class1.kt
|
||||
@file:Suppress("OPT_IN_USAGE")
|
||||
package Class1
|
||||
|
||||
<!EXPORTING_JS_NAME_CLASH_ES!>@JsExport class test<!>
|
||||
|
||||
// FILE: Class2.kt
|
||||
@file:Suppress("OPT_IN_USAGE")
|
||||
package Class2
|
||||
|
||||
<!EXPORTING_JS_NAME_CLASH_ES!>@JsExport class test<!>
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// FIR_IDENTICAL
|
||||
// FILE: A.kt
|
||||
@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH")
|
||||
package foo.bar
|
||||
|
||||
@JsExport
|
||||
val test = 1
|
||||
|
||||
// FILE: B.kt
|
||||
@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH")
|
||||
package foo
|
||||
|
||||
<!EXPORTING_JS_NAME_CLASH!>@JsExport fun bar() = 2<!>
|
||||
|
||||
// FILE: C.kt
|
||||
@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH")
|
||||
|
||||
<!EXPORTING_JS_NAME_CLASH!>@JsExport fun foo() = 2<!>
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// FIR_IDENTICAL
|
||||
// FILE: A.kt
|
||||
@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH")
|
||||
package foo.bar
|
||||
|
||||
@JsExport
|
||||
val test = 1
|
||||
|
||||
// FILE: B.kt
|
||||
@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH")
|
||||
package foo
|
||||
|
||||
<!EXPORTING_JS_NAME_CLASH!>@JsExport val bar = 2<!>
|
||||
|
||||
// FILE: C.kt
|
||||
@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH")
|
||||
|
||||
<!EXPORTING_JS_NAME_CLASH!>@JsExport val foo = 3<!>
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// FIR_IDENTICAL
|
||||
// FILE: A.kt
|
||||
@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH")
|
||||
package foo
|
||||
|
||||
<!EXPORTING_JS_NAME_CLASH, EXPORTING_JS_NAME_CLASH_ES!>@JsExport val test = 1<!>
|
||||
|
||||
// FILE: B.kt
|
||||
@file:Suppress("OPT_IN_USAGE", "JS_NAME_CLASH")
|
||||
package foo
|
||||
|
||||
<!EXPORTING_JS_NAME_CLASH, EXPORTING_JS_NAME_CLASH_ES!>@JsExport @JsName("test") val bar = 2<!>
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// FIR_IDENTICAL
|
||||
// FILE: A.kt
|
||||
@file:Suppress("OPT_IN_USAGE")
|
||||
package foo
|
||||
|
||||
<!EXPORTING_JS_NAME_CLASH_ES!>@JsExport val test = 1<!>
|
||||
|
||||
// FILE: B.kt
|
||||
@file:Suppress("OPT_IN_USAGE")
|
||||
package foo.bar
|
||||
|
||||
<!EXPORTING_JS_NAME_CLASH_ES!>@JsExport @JsName("test") val bar = 2<!>
|
||||
Reference in New Issue
Block a user