[FIR JS] Implement FirJsExportDeclarationChecker

This commit is contained in:
Nikolay Lunyak
2023-01-27 15:22:17 +02:00
parent 624162dc07
commit f644eb7988
38 changed files with 450 additions and 115 deletions
@@ -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)<!>