Skip to content

Commit

Permalink
[K2/JS] Add reproducer for KT-67978
Browse files Browse the repository at this point in the history
^KT-67978
  • Loading branch information
kunyavskiy committed May 6, 2024
1 parent aeedee0 commit 644dd05
Show file tree
Hide file tree
Showing 8 changed files with 288 additions and 0 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
// ISSUE: KT-64951

// MODULE: m1-common
// FILE: common1.kt

@Target(AnnotationTarget.FILE, AnnotationTarget.CLASS)
expect annotation class Export()

@Export
expect class <!WRONG_EXPORTED_DECLARATION!>WithExportOnExpect<!> {
<!WRONG_EXPORTED_DECLARATION!>fun foo()<!>
<!WRONG_EXPORTED_DECLARATION, WRONG_EXPORTED_DECLARATION!>val bar: Int<!>
}

expect class WithExportOnActual {
<!WRONG_EXPORTED_DECLARATION!>fun foo()<!>
<!WRONG_EXPORTED_DECLARATION, WRONG_EXPORTED_DECLARATION!>val bar: Int<!>
}

expect class WithExportTypealiasOnActual {
<!WRONG_EXPORTED_DECLARATION!>fun foo()<!>
<!WRONG_EXPORTED_DECLARATION, WRONG_EXPORTED_DECLARATION!>val bar: Int<!>
}

expect class <!WRONG_EXPORTED_DECLARATION!>WithFileExportOnActual<!> {
fun foo()
val bar: Int
}

// FILE: common2.kt
@file:Export

expect class WithExportOnExpectFile {
fun foo()
val bar: Int
}

// MODULE: m1-js()()(m1-common)

// FILE: annotation.kt
package kotlin.js

@Target(AnnotationTarget.FILE, AnnotationTarget.CLASS)
annotation class JsExport

// FILE: alias.kt
import kotlin.js.*

actual typealias Export = kotlin.js.JsExport

// FILE: js1.kt
import kotlin.js.*

@Export
actual class WithExportOnExpect {
actual fun foo() {}
actual val bar = 42
}

@JsExport
actual class WithExportOnActual {
actual fun foo() {}
actual val bar = 42
}

@Export
actual class WithExportTypealiasOnActual {
actual fun foo() {}
actual val bar = 42
}

// FILE: js2.kt
@file:JsExport
import kotlin.js.*

actual class WithFileExportOnActual {
actual fun foo() {}
actual val bar: Int = 42
}

// FILE: js3.kt

actual class WithExportOnExpectFile {
actual fun foo() {}
actual val bar: Int = 42
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
// ISSUE: KT-64951

// MODULE: m1-common
// FILE: common1.kt

@Target(AnnotationTarget.FILE, AnnotationTarget.CLASS)
expect annotation class Export()

@Export
expect class <!WRONG_EXPORTED_DECLARATION{JS}!>WithExportOnExpect<!> {
<!WRONG_EXPORTED_DECLARATION{JS}!>fun foo()<!>
<!WRONG_EXPORTED_DECLARATION{JS}!>val bar: Int<!>
}

expect class WithExportOnActual {
fun foo()
val bar: Int
}

expect class WithExportTypealiasOnActual {
fun foo()
val bar: Int
}

expect class WithFileExportOnActual {
fun foo()
val bar: Int
}

// FILE: common2.kt
@file:Export

expect class <!WRONG_EXPORTED_DECLARATION{JS}!>WithExportOnExpectFile<!> {
<!WRONG_EXPORTED_DECLARATION{JS}!>fun foo()<!>
<!WRONG_EXPORTED_DECLARATION{JS}!>val bar: Int<!>
}

// MODULE: m1-js()()(m1-common)

// FILE: annotation.kt
package kotlin.js

@Target(AnnotationTarget.FILE, AnnotationTarget.CLASS)
annotation class JsExport

// FILE: alias.kt
import kotlin.js.*

actual typealias Export = kotlin.js.JsExport

// FILE: js1.kt
import kotlin.js.*

@Export
actual class WithExportOnExpect {
actual fun foo() {}
actual val bar = 42
}

@JsExport
actual class WithExportOnActual {
actual fun foo() {}
actual val bar = 42
}

@Export
actual class WithExportTypealiasOnActual {
actual fun foo() {}
actual val bar = 42
}

// FILE: js2.kt
@file:JsExport
import kotlin.js.*

actual class WithFileExportOnActual {
actual fun foo() {}
actual val bar: Int = 42
}

// FILE: js3.kt

actual class WithExportOnExpectFile {
actual fun foo() {}
actual val bar: Int = 42
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
// ISSUE: KT-64951

// MODULE: m1-common
// FILE: common1.kt

@Target(AnnotationTarget.FILE, AnnotationTarget.CLASS)
expect annotation class Export()

@Export
expect class WithExportOnExpect {
fun foo()
val bar: Int
}

expect class WithExportOnActual {
fun foo()
val bar: Int
}

expect class WithExportTypealiasOnActual {
fun foo()
val bar: Int
}

expect class WithFileExportOnActual {
fun foo()
val bar: Int
}

// FILE: common2.kt
@file:Export

expect class WithExportOnExpectFile {
fun foo()
val bar: Int
}

// MODULE: m1-js()()(m1-common)

// FILE: annotation.kt
package kotlin.js

@Target(AnnotationTarget.FILE, AnnotationTarget.CLASS)
annotation class JsExport

// FILE: alias.kt
import kotlin.<!UNRESOLVED_IMPORT!>js<!>.*

actual typealias Export = kotlin.<!UNRESOLVED_REFERENCE!>js<!>.JsExport

// FILE: js1.kt
import kotlin.<!UNRESOLVED_IMPORT!>js<!>.*

@Export
actual class WithExportOnExpect {
actual fun foo() {}
actual val bar = 42
}

@<!UNRESOLVED_REFERENCE!>JsExport<!>
actual class WithExportOnActual {
actual fun foo() {}
actual val bar = 42
}

@Export
actual class WithExportTypealiasOnActual {
actual fun foo() {}
actual val bar = 42
}

// FILE: js2.kt
@file:<!UNRESOLVED_REFERENCE!>JsExport<!>
import kotlin.<!UNRESOLVED_IMPORT!>js<!>.*

actual class WithFileExportOnActual {
actual fun foo() {}
actual val bar: Int = 42
}

// FILE: js3.kt

actual class WithExportOnExpectFile {
actual fun foo() {}
actual val bar: Int = 42
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 644dd05

Please sign in to comment.