Reviewers: conroy,
Description:
Contradiction in terms, and makes the compiler blow up.
Please review this at http://gwt-code-reviews.appspot.com/1028801/show
Affected files:
M dev/core/src/com/google/gwt/dev/jjs/ast/JNonNullType.java
M dev/core/src/com/google/gwt/dev/jjs/ast/JProgram.java
Index: dev/core/src/com/google/gwt/dev/jjs/ast/JNonNullType.java
diff --git a/dev/core/src/com/google/gwt/dev/jjs/ast/JNonNullType.java
b/dev/core/src/com/google/gwt/dev/jjs/ast/JNonNullType.java
index
81e97704225ab44b3d0fd9c976a6b2ee4d338cd0..05edfed239b396c360b207d36a61e5410452ffe2
100644
--- a/dev/core/src/com/google/gwt/dev/jjs/ast/JNonNullType.java
+++ b/dev/core/src/com/google/gwt/dev/jjs/ast/JNonNullType.java
@@ -25,7 +25,7 @@ public class JNonNullType extends JReferenceType {
JNonNullType(JReferenceType ref) {
super(ref.getSourceInfo(), ref.getName());
- assert ref.canBeNull();
+ assert !(ref instanceof JNullType);
this.ref = ref;
}
Index: dev/core/src/com/google/gwt/dev/jjs/ast/JProgram.java
diff --git a/dev/core/src/com/google/gwt/dev/jjs/ast/JProgram.java
b/dev/core/src/com/google/gwt/dev/jjs/ast/JProgram.java
index
049958bc270245937e33fb7d0e343b489d51e51f..a5eac08d1bb2181b69bdc090131dd20bdaab6022
100644
--- a/dev/core/src/com/google/gwt/dev/jjs/ast/JProgram.java
+++ b/dev/core/src/com/google/gwt/dev/jjs/ast/JProgram.java
@@ -765,21 +765,18 @@ public class JProgram extends JNode {
}
public JsonObject getCastableTypeMap(JReferenceType referenceType) {
-
// ensure jsonCastableTypeMaps has been initialized
// it might not have been if the CastNormalizer has not been run
if (castableTypeMaps == null) {
initTypeInfo(null);
}
-
JsonObject returnMap = castableTypeMaps.get(referenceType);
if (returnMap == null) {
// add a new empty map
returnMap = new JsonObject(createSourceInfoSynthetic(JProgram.class,
- "empty map"),
getJavaScriptObject());
+ "empty map"), getJavaScriptObject());
castableTypeMaps.put(referenceType, returnMap);
}
-
return returnMap;
}
@@ -1158,12 +1155,10 @@ public class JProgram extends JNode {
public JPrimitiveType getTypeVoid() {
return JPrimitiveType.VOID;
}
-
+
public void initTypeInfo(
- IdentityHashMap<JReferenceType,JsonObject>
instantiatedTypeCastableTypeMaps) {
-
+ IdentityHashMap<JReferenceType, JsonObject>
instantiatedTypeCastableTypeMaps) {
castableTypeMaps = instantiatedTypeCastableTypeMaps;
-
if (castableTypeMaps == null || castableTypeMaps.size() == 0) {
castableTypeMaps = new IdentityHashMap<JReferenceType, JsonObject>();
}
@@ -1241,6 +1236,10 @@ public class JProgram extends JNode {
return type1;
}
+ if (type1 instanceof JNullType || type2 instanceof JNullType) {
+ return JNullType.INSTANCE;
+ }
+
if (type1 instanceof JNonNullType != type2 instanceof JNonNullType) {
// If either is non-nullable, the result should be non-nullable.
return strongerType(getNonNullType(type1), getNonNullType(type2));
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors