Index: pkg/dev_compiler/lib/src/compiler/side_effect_analysis.dart |
diff --git a/pkg/dev_compiler/lib/src/compiler/side_effect_analysis.dart b/pkg/dev_compiler/lib/src/compiler/side_effect_analysis.dart |
index 5da18eaa643858a9683ce347afda5baa991e1484..499cb862c7e9d1ea80284eff5d16631cf26851ba 100644 |
--- a/pkg/dev_compiler/lib/src/compiler/side_effect_analysis.dart |
+++ b/pkg/dev_compiler/lib/src/compiler/side_effect_analysis.dart |
@@ -8,7 +8,7 @@ import 'package:analyzer/dart/element/element.dart'; |
import 'package:analyzer/src/generated/constant.dart'; |
import 'package:analyzer/error/listener.dart' |
show AnalysisErrorListener, ErrorReporter; |
-import 'package:analyzer/src/generated/resolver.dart' show TypeProvider; |
+import 'package:analyzer/src/generated/engine.dart'; |
import 'package:analyzer/src/generated/source.dart' show Source; |
import 'package:analyzer/src/dart/ast/ast.dart'; |
@@ -105,12 +105,12 @@ class _AssignmentFinder extends RecursiveAstVisitor { |
} |
class ConstFieldVisitor { |
- final ConstantVisitor _constantVisitor; |
+ final ConstantVisitor constantVisitor; |
- ConstFieldVisitor(TypeProvider types, {Source dummySource}) |
- // TODO(jmesserly): support -D variables on the command line |
- : _constantVisitor = new ConstantVisitor( |
- new ConstantEvaluationEngine(types, new DeclaredVariables()), |
+ ConstFieldVisitor(AnalysisContext context, {Source dummySource}) |
+ : constantVisitor = new ConstantVisitor( |
+ new ConstantEvaluationEngine( |
+ context.typeProvider, context.declaredVariables), |
new ErrorReporter( |
AnalysisErrorListener.NULL_LISTENER, dummySource)); |
@@ -134,6 +134,6 @@ class ConstFieldVisitor { |
var initializer = field.initializer; |
if (initializer == null) return null; |
- return initializer.accept(_constantVisitor); |
+ return initializer.accept(constantVisitor); |
} |
} |