Build break fix: I was attempting to coerce to the wrong type, setting up an invalid AST state.
Review by: spoon (postmortem)
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@2503 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/dev/core/src/com/google/gwt/dev/jjs/impl/LongCastNormalizer.java b/dev/core/src/com/google/gwt/dev/jjs/impl/LongCastNormalizer.java
index 7a88422..cba4ebe 100644
--- a/dev/core/src/com/google/gwt/dev/jjs/impl/LongCastNormalizer.java
+++ b/dev/core/src/com/google/gwt/dev/jjs/impl/LongCastNormalizer.java
@@ -192,9 +192,10 @@
if (targetType != longType && argType != longType) {
return arg;
}
- if (arg instanceof JValueLiteral) {
+ if (arg instanceof JValueLiteral && targetType instanceof JPrimitiveType) {
// Attempt to coerce the literal.
- JValueLiteral coerced = longType.coerceLiteral((JValueLiteral) arg);
+ JPrimitiveType primitiveType = (JPrimitiveType) targetType;
+ JValueLiteral coerced = primitiveType.coerceLiteral((JValueLiteral) arg);
if (coerced != null) {
return coerced;
}