| Index: pkg/analyzer/lib/src/dart/analysis/analysis_impl.dart
|
| diff --git a/pkg/analyzer/lib/src/dart/analysis/analysis_impl.dart b/pkg/analyzer/lib/src/dart/analysis/analysis_impl.dart
|
| index 777142878956cdbc5fec418d87ad027b42862e1e..6682d5bc492e159565f403174127639e824c3b4e 100644
|
| --- a/pkg/analyzer/lib/src/dart/analysis/analysis_impl.dart
|
| +++ b/pkg/analyzer/lib/src/dart/analysis/analysis_impl.dart
|
| @@ -49,6 +49,7 @@ class AnalyzerImpl {
|
| final Map<FileState, ErrorReporter> _errorReporters = {};
|
| final List<UsedImportedElements> _usedImportedElementsList = [];
|
| final List<UsedLocalElements> _usedLocalElementsList = [];
|
| + final Map<FileState, List<PendingError>> _fileToPendingErrors = {};
|
| final List<ConstantEvaluationTarget> _constants = [];
|
|
|
| AnalyzerImpl(this._analysisOptions, this._declaredVariables,
|
| @@ -85,6 +86,7 @@ class AnalyzerImpl {
|
|
|
| units.forEach((file, unit) {
|
| _resolveFile(file, unit);
|
| + _computePendingMissingRequiredParameters(file, unit);
|
| });
|
|
|
| _computeConstants();
|
| @@ -142,21 +144,24 @@ class AnalyzerImpl {
|
| }
|
| }
|
|
|
| + void _computePendingMissingRequiredParameters(
|
| + FileState file, CompilationUnit unit) {
|
| + // TODO(scheglov) This can be done without "pending" if we resynthesize.
|
| + var computer = new RequiredConstantsComputer(file.source);
|
| + unit.accept(computer);
|
| + _constants.addAll(computer.requiredConstants);
|
| + _fileToPendingErrors[file] = computer.pendingErrors;
|
| + }
|
| +
|
| void _computeVerifyErrorsAndHints(FileState file, CompilationUnit unit) {
|
| RecordingErrorListener errorListener = _getErrorListener(file);
|
| CompilationUnitElement unitElement = unit.element;
|
|
|
| //
|
| - // Use the ErrorVerifier to compute errors.
|
| + // Convert the pending errors into actual errors.
|
| //
|
| - List<PendingError> pendingErrors;
|
| - {
|
| - RequiredConstantsComputer computer =
|
| - new RequiredConstantsComputer(file.source);
|
| - unit.accept(computer);
|
| - pendingErrors = computer.pendingErrors;
|
| - List<ConstantEvaluationTarget> requiredConstants =
|
| - computer.requiredConstants;
|
| + for (PendingError pendingError in _fileToPendingErrors[file]) {
|
| + errorListener.onError(pendingError.toAnalysisError());
|
| }
|
|
|
| if (_analysisOptions.strongMode) {
|
| @@ -197,13 +202,6 @@ class AnalyzerImpl {
|
| unit.accept(errorVerifier);
|
|
|
| //
|
| - // Convert the pending errors into actual errors.
|
| - //
|
| - for (PendingError pendingError in pendingErrors) {
|
| - errorListener.onError(pendingError.toAnalysisError());
|
| - }
|
| -
|
| - //
|
| // Find dead code.
|
| //
|
| unit.accept(
|
|
|