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

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: 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 865c1986e34b60bedf9c80d5ca90b2c89d412a80..f18d60c9d95c0035a66259ef8622c68e207da5db 100644
--- a/sdk/lib/_internal/compiler/implementation/types/inferrer_visitor.dart
+++ b/sdk/lib/_internal/compiler/implementation/types/inferrer_visitor.dart
@@ -8,8 +8,7 @@ TypeMask narrowType(TypeMask type,
DartType annotation,
Compiler compiler,
{bool isNullable: true}) {
- if (annotation.isDynamic) return type;
- if (annotation.isMalformed) return type;
+ if (annotation.treatAsDynamic) return type;
if (annotation.isVoid) return compiler.typesTask.nullType;
if (annotation.element == compiler.objectClass) return type;
TypeMask otherType;
@@ -598,7 +597,7 @@ abstract class InferrerVisitor extends ResolvedVisitor<TypeMask> {
Node exception = node.exception;
if (exception != null) {
DartType type = elements.getType(node.type);
- TypeMask mask = type == null
+ TypeMask mask = type == null || type.treatAsDynamic
? inferrer.dynamicType
: new TypeMask.nonNullSubtype(type.asRaw());
locals.update(elements[exception], mask);

Powered by Google App Engine
This is Rietveld 408576698