Example #1
0
 public static boolean isNullConstant(@NotNull JetExpression expression) {
   JetExpression deparenthesized = deparenthesize(expression);
   return deparenthesized instanceof JetConstantExpression
       && deparenthesized.getNode().getElementType() == JetNodeTypes.NULL;
 }
  public static boolean isTypeFlexible(@Nullable JetExpression expression) {
    if (expression == null) return false;

    return TokenSet.create(JetNodeTypes.INTEGER_CONSTANT, JetNodeTypes.FLOAT_CONSTANT)
        .contains(expression.getNode().getElementType());
  }