| Index: pkg/analyzer/lib/src/generated/incremental_resolver.dart
|
| diff --git a/pkg/analyzer/lib/src/generated/incremental_resolver.dart b/pkg/analyzer/lib/src/generated/incremental_resolver.dart
|
| index ea6aac756d505d21ec7899938dbe1227ef36478a..a4ff1f77084387695a7f8fadfbd3c43cd263ed04 100644
|
| --- a/pkg/analyzer/lib/src/generated/incremental_resolver.dart
|
| +++ b/pkg/analyzer/lib/src/generated/incremental_resolver.dart
|
| @@ -7,6 +7,7 @@ library engine.incremental_resolver;
|
| import 'dart:collection';
|
| import 'dart:math' as math;
|
|
|
| +import 'package:analyzer/src/generated/constant.dart';
|
| import 'package:analyzer/src/services/lint.dart';
|
|
|
| import 'ast.dart';
|
| @@ -883,6 +884,8 @@ class IncrementalResolver {
|
| }
|
| // resolve
|
| _resolveReferences(rootNode);
|
| + _computeConstants(rootNode);
|
| + _resolveErrors = errorListener.getErrorsForSource(_source);
|
| // verify
|
| _verify(rootNode);
|
| _context.invalidateLibraryHints(_librarySource);
|
| @@ -958,6 +961,27 @@ class IncrementalResolver {
|
| node is TopLevelVariableDeclaration;
|
|
|
| /**
|
| + * Compute a value for all of the constants in the given [node].
|
| + */
|
| + void _computeConstants(AstNode node) {
|
| + // compute values
|
| + {
|
| + CompilationUnit unit = node.getAncestor((n) => n is CompilationUnit);
|
| + ConstantValueComputer computer =
|
| + new ConstantValueComputer(_typeProvider, _context.declaredVariables);
|
| + computer.add(unit);
|
| + computer.computeValues();
|
| + }
|
| + // validate
|
| + {
|
| + ErrorReporter errorReporter = new ErrorReporter(errorListener, _source);
|
| + ConstantVerifier constantVerifier =
|
| + new ConstantVerifier(errorReporter, _definingLibrary, _typeProvider);
|
| + node.accept(constantVerifier);
|
| + }
|
| + }
|
| +
|
| + /**
|
| * Starting at [node], find the smallest AST node that can be resolved
|
| * independently of any other nodes. Return the node that was found.
|
| *
|
| @@ -1041,8 +1065,6 @@ class IncrementalResolver {
|
| visitor.initForIncrementalResolution();
|
| node.accept(visitor);
|
| }
|
| - // remember errors
|
| - _resolveErrors = errorListener.getErrorsForSource(_source);
|
| } finally {
|
| timer.stop('resolve references');
|
| }
|
|
|