[FIR JS] Implement FirJsExportDeclarationChecker
This commit is contained in:
Vendored
-15
@@ -1,15 +0,0 @@
|
||||
// !OPT_IN: kotlin.js.ExperimentalJsExport
|
||||
// !RENDER_DIAGNOSTICS_MESSAGES
|
||||
|
||||
package foo
|
||||
|
||||
@JsExport
|
||||
class C(val x: String) {
|
||||
constructor(x: Int): this(x.toString())
|
||||
}
|
||||
|
||||
@JsExport
|
||||
class C2(val x: String) {
|
||||
@JsName("JsNameProvided")
|
||||
constructor(x: Int): this(x.toString())
|
||||
}
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !OPT_IN: kotlin.js.ExperimentalJsExport
|
||||
// !RENDER_DIAGNOSTICS_MESSAGES
|
||||
|
||||
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
// !OPT_IN: kotlin.js.ExperimentalJsExport
|
||||
// !RENDER_DIAGNOSTICS_MESSAGES
|
||||
@file:JsExport
|
||||
|
||||
package foo
|
||||
|
||||
class C(val x: String) {
|
||||
constructor(x: Int): this(x.toString())
|
||||
}
|
||||
|
||||
class C2(val x: String) {
|
||||
@JsName("JsNameProvided")
|
||||
constructor(x: Int): this(x.toString())
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !OPT_IN: kotlin.js.ExperimentalJsExport
|
||||
// !RENDER_DIAGNOSTICS_MESSAGES
|
||||
@file:JsExport
|
||||
|
||||
+13
-13
@@ -4,18 +4,18 @@
|
||||
|
||||
package foo
|
||||
|
||||
@JsExport
|
||||
inline fun <reified T> inlineReifiedFun(x: Any) = x is T
|
||||
<!WRONG_EXPORTED_DECLARATION("inline function with reified type parameters")!>@JsExport
|
||||
inline fun <reified T> inlineReifiedFun(x: Any)<!> = x is T
|
||||
|
||||
@JsExport
|
||||
suspend fun suspendFun() { }
|
||||
<!WRONG_EXPORTED_DECLARATION("suspend function")!>@JsExport
|
||||
suspend fun suspendFun()<!> { }
|
||||
|
||||
@JsExport
|
||||
val String.extensionProperty
|
||||
<!WRONG_EXPORTED_DECLARATION("extension property")!>@JsExport
|
||||
val String.extensionProperty<!>
|
||||
get() = this.length
|
||||
|
||||
@JsExport
|
||||
annotation class AnnotationClass
|
||||
annotation class <!WRONG_EXPORTED_DECLARATION("annotation class")!>AnnotationClass<!>
|
||||
|
||||
@JsExport
|
||||
interface SomeInterface
|
||||
@@ -25,24 +25,24 @@ external interface GoodInterface
|
||||
|
||||
@JsExport
|
||||
interface InterfaceWithCompanion {
|
||||
companion object {
|
||||
companion <!WRONG_EXPORTED_DECLARATION("companion object inside exported interface")!>object<!> {
|
||||
fun foo() = 42
|
||||
}
|
||||
}
|
||||
|
||||
@JsExport
|
||||
interface OuterInterface {
|
||||
class Nested
|
||||
class <!WRONG_EXPORTED_DECLARATION("nested class inside exported interface")!>Nested<!>
|
||||
}
|
||||
|
||||
@JsExport
|
||||
value class A(val a: Int)
|
||||
value class <!WRONG_EXPORTED_DECLARATION("value class")!>A(val a: Int)<!>
|
||||
|
||||
@JsExport
|
||||
inline class B(val b: Int)
|
||||
inline class <!WRONG_EXPORTED_DECLARATION("value class")!>B(val b: Int)<!>
|
||||
|
||||
@JsExport
|
||||
inline value class C(val c: Int)
|
||||
inline value class <!WRONG_EXPORTED_DECLARATION("value class")!>C(val c: Int)<!>
|
||||
|
||||
@JsExport
|
||||
value inline class D(val d: Int)
|
||||
value inline class <!WRONG_EXPORTED_DECLARATION("value class")!>D(val d: Int)<!>
|
||||
|
||||
compiler/testData/diagnostics/testsWithJsStdLib/export/wrongExportedDeclarationInExportedFile.fir.kt
Vendored
-15
@@ -1,15 +0,0 @@
|
||||
// !OPT_IN: kotlin.js.ExperimentalJsExport
|
||||
// !RENDER_DIAGNOSTICS_MESSAGES
|
||||
|
||||
@file:JsExport
|
||||
|
||||
package foo
|
||||
|
||||
inline fun <reified T> inlineReifiedFun(x: Any) = x is T
|
||||
|
||||
suspend fun suspendFun() { }
|
||||
|
||||
val String.extensionProperty
|
||||
get() = this.length
|
||||
|
||||
annotation class AnnotationClass
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !OPT_IN: kotlin.js.ExperimentalJsExport
|
||||
// !RENDER_DIAGNOSTICS_MESSAGES
|
||||
|
||||
|
||||
Reference in New Issue
Block a user