if ((type instanceof JPrimitiveType) && (exp instanceof JValueLiteral)) {
// Statically evaluate casting literals.
JPrimitiveType primitiveType = (JPrimitiveType) type;
JValueLiteral expLit = (JValueLiteral) exp;
JValueLiteral casted = primitiveType.coerce(expLit);
if (casted != null) {
return casted;
}
}