Skip to content

Commit 644dd05

Browse files
committed
[K2/JS] Add reproducer for KT-67978
^KT-67978
1 parent aeedee0 commit 644dd05

File tree

8 files changed

+288
-0
lines changed

8 files changed

+288
-0
lines changed

analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendMPPDiagnosticsWithLightTreeTestGenerated.java

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendMPPDiagnosticsWithPsiTestGenerated.java

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
// ISSUE: KT-64951
2+
3+
// MODULE: m1-common
4+
// FILE: common1.kt
5+
6+
@Target(AnnotationTarget.FILE, AnnotationTarget.CLASS)
7+
expect annotation class Export()
8+
9+
@Export
10+
expect class <!WRONG_EXPORTED_DECLARATION!>WithExportOnExpect<!> {
11+
<!WRONG_EXPORTED_DECLARATION!>fun foo()<!>
12+
<!WRONG_EXPORTED_DECLARATION, WRONG_EXPORTED_DECLARATION!>val bar: Int<!>
13+
}
14+
15+
expect class WithExportOnActual {
16+
<!WRONG_EXPORTED_DECLARATION!>fun foo()<!>
17+
<!WRONG_EXPORTED_DECLARATION, WRONG_EXPORTED_DECLARATION!>val bar: Int<!>
18+
}
19+
20+
expect class WithExportTypealiasOnActual {
21+
<!WRONG_EXPORTED_DECLARATION!>fun foo()<!>
22+
<!WRONG_EXPORTED_DECLARATION, WRONG_EXPORTED_DECLARATION!>val bar: Int<!>
23+
}
24+
25+
expect class <!WRONG_EXPORTED_DECLARATION!>WithFileExportOnActual<!> {
26+
fun foo()
27+
val bar: Int
28+
}
29+
30+
// FILE: common2.kt
31+
@file:Export
32+
33+
expect class WithExportOnExpectFile {
34+
fun foo()
35+
val bar: Int
36+
}
37+
38+
// MODULE: m1-js()()(m1-common)
39+
40+
// FILE: annotation.kt
41+
package kotlin.js
42+
43+
@Target(AnnotationTarget.FILE, AnnotationTarget.CLASS)
44+
annotation class JsExport
45+
46+
// FILE: alias.kt
47+
import kotlin.js.*
48+
49+
actual typealias Export = kotlin.js.JsExport
50+
51+
// FILE: js1.kt
52+
import kotlin.js.*
53+
54+
@Export
55+
actual class WithExportOnExpect {
56+
actual fun foo() {}
57+
actual val bar = 42
58+
}
59+
60+
@JsExport
61+
actual class WithExportOnActual {
62+
actual fun foo() {}
63+
actual val bar = 42
64+
}
65+
66+
@Export
67+
actual class WithExportTypealiasOnActual {
68+
actual fun foo() {}
69+
actual val bar = 42
70+
}
71+
72+
// FILE: js2.kt
73+
@file:JsExport
74+
import kotlin.js.*
75+
76+
actual class WithFileExportOnActual {
77+
actual fun foo() {}
78+
actual val bar: Int = 42
79+
}
80+
81+
// FILE: js3.kt
82+
83+
actual class WithExportOnExpectFile {
84+
actual fun foo() {}
85+
actual val bar: Int = 42
86+
}
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
// ISSUE: KT-64951
2+
3+
// MODULE: m1-common
4+
// FILE: common1.kt
5+
6+
@Target(AnnotationTarget.FILE, AnnotationTarget.CLASS)
7+
expect annotation class Export()
8+
9+
@Export
10+
expect class <!WRONG_EXPORTED_DECLARATION{JS}!>WithExportOnExpect<!> {
11+
<!WRONG_EXPORTED_DECLARATION{JS}!>fun foo()<!>
12+
<!WRONG_EXPORTED_DECLARATION{JS}!>val bar: Int<!>
13+
}
14+
15+
expect class WithExportOnActual {
16+
fun foo()
17+
val bar: Int
18+
}
19+
20+
expect class WithExportTypealiasOnActual {
21+
fun foo()
22+
val bar: Int
23+
}
24+
25+
expect class WithFileExportOnActual {
26+
fun foo()
27+
val bar: Int
28+
}
29+
30+
// FILE: common2.kt
31+
@file:Export
32+
33+
expect class <!WRONG_EXPORTED_DECLARATION{JS}!>WithExportOnExpectFile<!> {
34+
<!WRONG_EXPORTED_DECLARATION{JS}!>fun foo()<!>
35+
<!WRONG_EXPORTED_DECLARATION{JS}!>val bar: Int<!>
36+
}
37+
38+
// MODULE: m1-js()()(m1-common)
39+
40+
// FILE: annotation.kt
41+
package kotlin.js
42+
43+
@Target(AnnotationTarget.FILE, AnnotationTarget.CLASS)
44+
annotation class JsExport
45+
46+
// FILE: alias.kt
47+
import kotlin.js.*
48+
49+
actual typealias Export = kotlin.js.JsExport
50+
51+
// FILE: js1.kt
52+
import kotlin.js.*
53+
54+
@Export
55+
actual class WithExportOnExpect {
56+
actual fun foo() {}
57+
actual val bar = 42
58+
}
59+
60+
@JsExport
61+
actual class WithExportOnActual {
62+
actual fun foo() {}
63+
actual val bar = 42
64+
}
65+
66+
@Export
67+
actual class WithExportTypealiasOnActual {
68+
actual fun foo() {}
69+
actual val bar = 42
70+
}
71+
72+
// FILE: js2.kt
73+
@file:JsExport
74+
import kotlin.js.*
75+
76+
actual class WithFileExportOnActual {
77+
actual fun foo() {}
78+
actual val bar: Int = 42
79+
}
80+
81+
// FILE: js3.kt
82+
83+
actual class WithExportOnExpectFile {
84+
actual fun foo() {}
85+
actual val bar: Int = 42
86+
}
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
// ISSUE: KT-64951
2+
3+
// MODULE: m1-common
4+
// FILE: common1.kt
5+
6+
@Target(AnnotationTarget.FILE, AnnotationTarget.CLASS)
7+
expect annotation class Export()
8+
9+
@Export
10+
expect class WithExportOnExpect {
11+
fun foo()
12+
val bar: Int
13+
}
14+
15+
expect class WithExportOnActual {
16+
fun foo()
17+
val bar: Int
18+
}
19+
20+
expect class WithExportTypealiasOnActual {
21+
fun foo()
22+
val bar: Int
23+
}
24+
25+
expect class WithFileExportOnActual {
26+
fun foo()
27+
val bar: Int
28+
}
29+
30+
// FILE: common2.kt
31+
@file:Export
32+
33+
expect class WithExportOnExpectFile {
34+
fun foo()
35+
val bar: Int
36+
}
37+
38+
// MODULE: m1-js()()(m1-common)
39+
40+
// FILE: annotation.kt
41+
package kotlin.js
42+
43+
@Target(AnnotationTarget.FILE, AnnotationTarget.CLASS)
44+
annotation class JsExport
45+
46+
// FILE: alias.kt
47+
import kotlin.<!UNRESOLVED_IMPORT!>js<!>.*
48+
49+
actual typealias Export = kotlin.<!UNRESOLVED_REFERENCE!>js<!>.JsExport
50+
51+
// FILE: js1.kt
52+
import kotlin.<!UNRESOLVED_IMPORT!>js<!>.*
53+
54+
@Export
55+
actual class WithExportOnExpect {
56+
actual fun foo() {}
57+
actual val bar = 42
58+
}
59+
60+
@<!UNRESOLVED_REFERENCE!>JsExport<!>
61+
actual class WithExportOnActual {
62+
actual fun foo() {}
63+
actual val bar = 42
64+
}
65+
66+
@Export
67+
actual class WithExportTypealiasOnActual {
68+
actual fun foo() {}
69+
actual val bar = 42
70+
}
71+
72+
// FILE: js2.kt
73+
@file:<!UNRESOLVED_REFERENCE!>JsExport<!>
74+
import kotlin.<!UNRESOLVED_IMPORT!>js<!>.*
75+
76+
actual class WithFileExportOnActual {
77+
actual fun foo() {}
78+
actual val bar: Int = 42
79+
}
80+
81+
// FILE: js3.kt
82+
83+
actual class WithExportOnExpectFile {
84+
actual fun foo() {}
85+
actual val bar: Int = 42
86+
}

compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)