http://gwt-code-reviews.appspot.com/1385803/diff/2002/dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java File dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java (right):
http://gwt-code-reviews.appspot.com/1385803/diff/2002/dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java#newcode298 dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java:298: LongCastNormalizer.exec(jprogram); Can you just describe for posterity why this is needed? http://gwt-code-reviews.appspot.com/1385803/diff/2002/dev/core/src/com/google/gwt/dev/jjs/impl/PostOptimizationCompoundAssignmentNormalizer.java File dev/core/src/com/google/gwt/dev/jjs/impl/PostOptimizationCompoundAssignmentNormalizer.java (right): http://gwt-code-reviews.appspot.com/1385803/diff/2002/dev/core/src/com/google/gwt/dev/jjs/impl/PostOptimizationCompoundAssignmentNormalizer.java#newcode70 dev/core/src/com/google/gwt/dev/jjs/impl/PostOptimizationCompoundAssignmentNormalizer.java:70: if (isIntegral(lhsType) && !isIntegral(rhsType)) { I almost think this ought to be: if (widen(lhsType, rhsType) != lhsType)) { ... } http://gwt-code-reviews.appspot.com/1385803/diff/2002/dev/core/src/com/google/gwt/dev/jjs/impl/PostOptimizationCompoundAssignmentNormalizer.java#newcode95 dev/core/src/com/google/gwt/dev/jjs/impl/PostOptimizationCompoundAssignmentNormalizer.java:95: widenType(type, JPrimitiveType.LONG) == JPrimitiveType.LONG; Cute, but it hard to just read this and prove to yourself it's correct. Can we just do the explicit thing here? http://gwt-code-reviews.appspot.com/1385803/diff/2002/dev/core/src/com/google/gwt/dev/jjs/impl/PostOptimizationCompoundAssignmentNormalizer.java#newcode98 dev/core/src/com/google/gwt/dev/jjs/impl/PostOptimizationCompoundAssignmentNormalizer.java:98: private JType widenType(JType lhsType, JType rhsType) { Did you copy this from somewhere, or is there a JLS section you can cite for this? http://gwt-code-reviews.appspot.com/1385803/diff/2002/dev/core/test/com/google/gwt/dev/jjs/impl/PostOptimizationCompoundAssignmentNormalizerTest.java File dev/core/test/com/google/gwt/dev/jjs/impl/PostOptimizationCompoundAssignmentNormalizerTest.java (right): http://gwt-code-reviews.appspot.com/1385803/diff/2002/dev/core/test/com/google/gwt/dev/jjs/impl/PostOptimizationCompoundAssignmentNormalizerTest.java#newcode74 dev/core/test/com/google/gwt/dev/jjs/impl/PostOptimizationCompoundAssignmentNormalizerTest.java:74: "int x=2; short d=3; x += d;"); OTOH, short += int should get split up, can you add a test for that? http://gwt-code-reviews.appspot.com/1385803/diff/2002/dev/core/test/com/google/gwt/dev/jjs/impl/PostOptimizationCompoundAssignmentNormalizerTest.java#newcode77 dev/core/test/com/google/gwt/dev/jjs/impl/PostOptimizationCompoundAssignmentNormalizerTest.java:77: "int x=2; long d=3L; x += (int)d;"); I'm surprised, I would have thought this would be split. If you write int = int + long you have to coerce the result to int. http://gwt-code-reviews.appspot.com/1385803/diff/2002/dev/core/test/com/google/gwt/dev/jjs/impl/PostOptimizationCompoundAssignmentNormalizerTest.java#newcode86 dev/core/test/com/google/gwt/dev/jjs/impl/PostOptimizationCompoundAssignmentNormalizerTest.java:86: "float x=2; double d=3.0; x += d;"); Same here, float = float + double forces you to coerce. http://gwt-code-reviews.appspot.com/1385803/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors