Index: sdk/lib/_internal/compiler/implementation/inferrer/type_graph_inferrer.dart |
diff --git a/sdk/lib/_internal/compiler/implementation/inferrer/type_graph_inferrer.dart b/sdk/lib/_internal/compiler/implementation/inferrer/type_graph_inferrer.dart |
index d7375f66a2b2358fd66003d7bf6c797eb2ec6d2e..caadbaca245bac1c08a31a477600dbcddd378bc6 100644 |
--- a/sdk/lib/_internal/compiler/implementation/inferrer/type_graph_inferrer.dart |
+++ b/sdk/lib/_internal/compiler/implementation/inferrer/type_graph_inferrer.dart |
@@ -213,7 +213,7 @@ class TypeInformationSystem extends TypeSystem<TypeInformation> { |
{bool isNullable: true}) { |
if (annotation.treatAsDynamic) return type; |
if (annotation.isVoid) return nullType; |
- if (annotation.element == compiler.objectClass) return type; |
+ if (annotation.element == compiler.objectClass && isNullable) return type; |
TypeMask otherType; |
if (annotation.isTypedef || annotation.isFunctionType) { |
otherType = functionType.type; |
@@ -222,7 +222,9 @@ class TypeInformationSystem extends TypeSystem<TypeInformation> { |
return type; |
} else { |
assert(annotation.isInterfaceType); |
- otherType = new TypeMask.nonNullSubtype(annotation.element); |
+ otherType = annotation.element == compiler.objectClass |
+ ? dynamicType.type.nonNullable() |
floitsch
2014/08/15 17:37:44
Why is this necessary?
Isn't that the same?
herhut
2014/08/18 08:06:51
We can have [subclass object] and [subtype object]
|
+ : new TypeMask.nonNullSubtype(annotation.element); |
} |
if (isNullable) otherType = otherType.nullable(); |
if (type.type.isExact) { |