[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
@@ -203,7 +203,7 @@ object FirJsExportDeclarationChecker : FirBasicDeclarationChecker() {
val nonNullable = withNullability(ConeNullability.NOT_NULL, session.typeContext)
val isPrimitiveExportableType = nonNullable.isAny || nonNullable.isNullableAny
|| nonNullable is ConeDynamicType || isPrimitiveExportableConeKotlinType
|| nonNullable is ConeDynamicType || nonNullable.isPrimitiveExportableConeKotlinType
val symbol = toSymbol(session)
return when {
@@ -222,7 +222,8 @@ object FirJsExportDeclarationChecker : FirBasicDeclarationChecker() {
|| isString
|| isPrimitiveNumberOrNullableType && !isLong
|| isNothingOrNullableNothing
|| isArrayType
|| isPrimitiveArray
|| isNonPrimitiveArray
private fun validateDeclarationOnConsumableName(
declaration: FirMemberDeclaration,