From 4f64a6c7e2d83ef6018e2a8f556c6ba093b08ee8 Mon Sep 17 00:00:00 2001 From: Alex Tkachman Date: Tue, 30 Aug 2011 16:28:49 +0200 Subject: [PATCH] isPrimitive method added --- .../org/jetbrains/jet/codegen/JetTypeMapper.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/idea/src/org/jetbrains/jet/codegen/JetTypeMapper.java b/idea/src/org/jetbrains/jet/codegen/JetTypeMapper.java index ce26f8dc6dc..ddb3a463377 100644 --- a/idea/src/org/jetbrains/jet/codegen/JetTypeMapper.java +++ b/idea/src/org/jetbrains/jet/codegen/JetTypeMapper.java @@ -47,6 +47,19 @@ public class JetTypeMapper { return type == Type.INT_TYPE || type == Type.SHORT_TYPE || type == Type.BYTE_TYPE || type == Type.CHAR_TYPE; } + public static boolean isPrimitive(Type type) { + return type == Type.INT_TYPE + || type == Type.SHORT_TYPE + || type == Type.BYTE_TYPE + || type == Type.CHAR_TYPE + || type == Type.SHORT_TYPE + || type == Type.FLOAT_TYPE + || type == Type.DOUBLE_TYPE + || type == Type.LONG_TYPE + || type == Type.BOOLEAN_TYPE + || type == Type.VOID_TYPE; + } + static Type psiTypeToAsm(PsiType type) { if (type instanceof PsiPrimitiveType) { if (type == PsiType.VOID) {