Index: sdk/lib/_internal/compiler/implementation/types/inferrer_visitor.dart |
diff --git a/sdk/lib/_internal/compiler/implementation/types/inferrer_visitor.dart b/sdk/lib/_internal/compiler/implementation/types/inferrer_visitor.dart |
index 2c127ad26ce4dcf619649e5ec729c04441b2aca1..12389eef60e7aa2771c0cce057c8d51bd380bdad 100644 |
--- a/sdk/lib/_internal/compiler/implementation/types/inferrer_visitor.dart |
+++ b/sdk/lib/_internal/compiler/implementation/types/inferrer_visitor.dart |
@@ -84,8 +84,7 @@ class TypeMaskSystem implements TypeSystem<TypeMask> { |
TypeMask narrowType(TypeMask type, |
DartType annotation, |
{bool isNullable: true}) { |
- if (annotation.isDynamic) return type; |
- if (annotation.isMalformed) return type; |
+ if (annotation.treatAsDynamic) return type; |
if (annotation.isVoid) return nullType; |
if (annotation.element == compiler.objectClass) return type; |
TypeMask otherType; |
@@ -869,7 +868,7 @@ abstract class InferrerVisitor<T> extends ResolvedVisitor<T> { |
Node exception = node.exception; |
if (exception != null) { |
DartType type = elements.getType(node.type); |
- T mask = type == null |
+ T mask = type == null || type.treatAsDynamic |
? types.dynamicType |
: types.nonNullSubtype(type.asRaw()); |
locals.update(elements[exception], mask, node); |