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 5feaaa9558837b31161f9cadc6a81e48c331f5c5..3e4cc5438322320d5befbd068222edfb5bfceec0 100644 |
--- a/pkg/analyzer/lib/src/generated/incremental_resolver.dart |
+++ b/pkg/analyzer/lib/src/generated/incremental_resolver.dart |
@@ -896,6 +896,11 @@ class IncrementalResolver { |
int _updateDelta; |
+ /** |
+ * The set of [AnalysisError]s that have been already shifted. |
+ */ |
+ Set<AnalysisError> _alreadyShiftedErrors = new HashSet.identity(); |
+ |
RecordingErrorListener errorListener = new RecordingErrorListener(); |
ResolutionContext _resolutionContext; |
@@ -1146,9 +1151,11 @@ class IncrementalResolver { |
void _shiftErrors(List<AnalysisError> errors) { |
for (AnalysisError error in errors) { |
- int errorOffset = error.offset; |
- if (errorOffset > _updateOffset) { |
- error.offset += _updateDelta; |
+ if (_alreadyShiftedErrors.add(error)) { |
+ int errorOffset = error.offset; |
+ if (errorOffset > _updateOffset) { |
+ error.offset += _updateDelta; |
+ } |
} |
} |
} |