[JS IR BE] Implement isPrimitiveArray with pure Ir

This commit is contained in:
Roman Artemev
2019-02-04 18:59:21 +03:00
committed by romanart
parent 3a444cd0f3
commit d034ce106e
5 changed files with 20 additions and 18 deletions
@@ -17,9 +17,6 @@ import org.jetbrains.kotlin.types.typeUtil.isSubtypeOf
// TODO: implement pure Ir-based function (see IrTypeUtils.kt)
@Deprecated("Use pure Ir helper")
fun IrType.isPrimitiveArray() = KotlinBuiltIns.isPrimitiveArray(toKotlinType())
@Deprecated("Use pure Ir helper")
fun IrType.getPrimitiveArrayElementType() = KotlinBuiltIns.getPrimitiveArrayElementType(toKotlinType())
@@ -5,6 +5,7 @@
package org.jetbrains.kotlin.ir.util
import org.jetbrains.kotlin.builtins.KotlinBuiltIns.FQ_NAMES
import org.jetbrains.kotlin.builtins.UnsignedTypes
import org.jetbrains.kotlin.descriptors.ClassKind
import org.jetbrains.kotlin.ir.declarations.IrClass
@@ -91,3 +92,4 @@ private inline fun IrType.isTypeFromKotlinPackage(namePredicate: (Name) -> Boole
} else return false
}
fun IrType.isPrimitiveArray() = isTypeFromKotlinPackage { it in FQ_NAMES.primitiveArrayTypeShortNames }