Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Unified Diff: sdk/lib/_internal/compiler/implementation/types/inferrer_visitor.dart

Issue 19097003: Support new malformed types semantics. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix unittests. Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698