[JS FIR] Fix the JsExport diagnostic for nullable primitive types

- Correctly handle nullable primitive types.
- Unsigned primitive arrays are not exportable.

^KT-64366 Fixed
This commit is contained in:
Alexander Korepanov
2023-12-18 13:00:30 +01:00
committed by Space Team
parent c4fc0b919d
commit 89e2af2047
5 changed files with 121 additions and 2 deletions
@@ -0,0 +1,72 @@
// !OPT_IN: kotlin.js.ExperimentalJsExport kotlin.ExperimentalUnsignedTypes
// FIR_IDENTICAL
@JsExport
fun any(): Any? = null
@JsExport
fun <T> generic(): T? = null
@JsExport
fun nothing(): Nothing? = null
@JsExport
fun throwable(): Throwable? = null
<!NON_EXPORTABLE_TYPE!>@JsExport
fun unit(): Unit?<!> = null
<!NON_EXPORTABLE_TYPE!>@JsExport
fun char(): Char?<!> = null
<!NON_EXPORTABLE_TYPE!>@JsExport
fun charSeq(): CharSequence?<!> = null
<!NON_EXPORTABLE_TYPE!>@JsExport
fun number(): Number?<!> = null
@JsExport
fun str(): String? = null
@JsExport
fun bool(): Boolean? = null
@JsExport
fun byte(): Byte? = null
@JsExport
fun short(): Short? = null
@JsExport
fun int(): Int? = null
@JsExport
fun double(): Double? = null
@JsExport
fun float(): Float? = null
<!NON_EXPORTABLE_TYPE!>@JsExport
fun ubyte(): UByte?<!> = null
<!NON_EXPORTABLE_TYPE!>@JsExport
fun ushort(): UShort?<!> = null
<!NON_EXPORTABLE_TYPE!>@JsExport
fun uint(): UInt?<!> = null
<!NON_EXPORTABLE_TYPE!>@JsExport
fun long(): Long?<!> = null
<!NON_EXPORTABLE_TYPE!>@JsExport
fun ulong(): ULong?<!> = null
@JsExport
fun arr(): Array<Int>? = null
@JsExport
fun boolArr(): BooleanArray? = null
@JsExport
fun byteArr(): ByteArray? = null
@JsExport
fun shortArr(): ShortArray? = null
@JsExport
fun intArr(): IntArray? = null
@JsExport
fun longArr(): LongArray? = null
@JsExport
fun floatArr(): FloatArray? = null
@JsExport
fun doubleArr(): DoubleArray? = null
<!NON_EXPORTABLE_TYPE!>@JsExport
fun ubyteArr(): UByteArray?<!> = null
<!NON_EXPORTABLE_TYPE!>@JsExport
fun ushortArr(): UShortArray?<!> = null
<!NON_EXPORTABLE_TYPE!>@JsExport
fun uintArr(): UIntArray?<!> = null
<!NON_EXPORTABLE_TYPE!>@JsExport
fun ulongArr(): ULongArray?<!> = null
@@ -0,0 +1,34 @@
package
@kotlin.js.JsExport public fun any(): kotlin.Any?
@kotlin.js.JsExport public fun arr(): kotlin.Array<kotlin.Int>?
@kotlin.js.JsExport public fun bool(): kotlin.Boolean?
@kotlin.js.JsExport public fun boolArr(): kotlin.BooleanArray?
@kotlin.js.JsExport public fun byte(): kotlin.Byte?
@kotlin.js.JsExport public fun byteArr(): kotlin.ByteArray?
@kotlin.js.JsExport public fun char(): kotlin.Char?
@kotlin.js.JsExport public fun charSeq(): kotlin.CharSequence?
@kotlin.js.JsExport public fun double(): kotlin.Double?
@kotlin.js.JsExport public fun doubleArr(): kotlin.DoubleArray?
@kotlin.js.JsExport public fun float(): kotlin.Float?
@kotlin.js.JsExport public fun floatArr(): kotlin.FloatArray?
@kotlin.js.JsExport public fun </*0*/ T> generic(): T?
@kotlin.js.JsExport public fun int(): kotlin.Int?
@kotlin.js.JsExport public fun intArr(): kotlin.IntArray?
@kotlin.js.JsExport public fun long(): kotlin.Long?
@kotlin.js.JsExport public fun longArr(): kotlin.LongArray?
@kotlin.js.JsExport public fun nothing(): kotlin.Nothing?
@kotlin.js.JsExport public fun number(): kotlin.Number?
@kotlin.js.JsExport public fun short(): kotlin.Short?
@kotlin.js.JsExport public fun shortArr(): kotlin.ShortArray?
@kotlin.js.JsExport public fun str(): kotlin.String?
@kotlin.js.JsExport public fun throwable(): kotlin.Throwable?
@kotlin.js.JsExport public fun ubyte(): kotlin.UByte?
@kotlin.js.JsExport public fun ubyteArr(): kotlin.UByteArray?
@kotlin.js.JsExport public fun uint(): kotlin.UInt?
@kotlin.js.JsExport public fun uintArr(): kotlin.UIntArray?
@kotlin.js.JsExport public fun ulong(): kotlin.ULong?
@kotlin.js.JsExport public fun ulongArr(): kotlin.ULongArray?
@kotlin.js.JsExport public fun unit(): kotlin.Unit?
@kotlin.js.JsExport public fun ushort(): kotlin.UShort?
@kotlin.js.JsExport public fun ushortArr(): kotlin.UShortArray?