Index: pkg/compiler/lib/src/inferrer/inferrer_visitor.dart |
diff --git a/pkg/compiler/lib/src/inferrer/inferrer_visitor.dart b/pkg/compiler/lib/src/inferrer/inferrer_visitor.dart |
index 08fa94517b41c3e90569a3ab0e8f72093c5fb3e4..482eb115544bffe517a66fa2329e014287e7354f 100644 |
--- a/pkg/compiler/lib/src/inferrer/inferrer_visitor.dart |
+++ b/pkg/compiler/lib/src/inferrer/inferrer_visitor.dart |
@@ -758,14 +758,6 @@ abstract class InferrerVisitor<T, E extends MinimalInferrerEngine<T>> |
T handleDynamicInvoke(Send node); |
- T visitAssert(Assert node) { |
- // Avoid pollution from assert statement unless enabled. |
- if (compiler.enableUserAssertions) { |
- super.visitAssert(node); |
- } |
- return null; |
- } |
- |
T visitAsyncForIn(AsyncForIn node); |
T visitSyncForIn(SyncForIn node); |
@@ -804,6 +796,17 @@ abstract class InferrerVisitor<T, E extends MinimalInferrerEngine<T>> |
return types.dynamicType; |
} |
+ @override |
+ T visitAssert(Send node, Node expression, _) { |
+ if (!compiler.enableUserAssertions) { |
+ return types.nullType; |
+ } |
+ return handleAssert(node, expression); |
+ } |
+ |
+ /// Handle an enabled assertion of [expression]. |
+ T handleAssert(Send node, Node expression); |
+ |
T visitNode(Node node) { |
return node.visitChildren(this); |
} |