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 ac7870dab8089665bcc9748817357f533b25e0f0..1194f5f2a5f495c13668ccde24df7b5191cd8bbd 100644 |
--- a/pkg/analyzer/lib/src/generated/incremental_resolver.dart |
+++ b/pkg/analyzer/lib/src/generated/incremental_resolver.dart |
@@ -1205,19 +1205,13 @@ class _ElementOffsetUpdater extends GeneralizingElementVisitor { |
// name offset |
int nameOffset = element.nameOffset; |
if (nameOffset > updateOffset) { |
- // TODO(scheglov) make sure that we don't put local variables |
- // and functions into the cache at all. |
- try { |
- (element as ElementImpl).nameOffset = nameOffset + updateDelta; |
- } on FrozenHashCodeException { |
- cache.remove(element); |
- (element as ElementImpl).nameOffset = nameOffset + updateDelta; |
- } |
+ (element as ElementImpl).nameOffset = nameOffset + updateDelta; |
if (element is ConstVariableElement) { |
Expression initializer = element.constantInitializer; |
if (initializer != null) { |
_shiftTokens(initializer.beginToken); |
} |
+ _shiftErrors(element.evaluationResult?.errors); |
} |
} |
// code range |
@@ -1260,6 +1254,17 @@ class _ElementOffsetUpdater extends GeneralizingElementVisitor { |
super.visitElement(element); |
} |
+ void _shiftErrors(List<AnalysisError> errors) { |
+ if (errors != null) { |
+ for (AnalysisError error in errors) { |
+ int errorOffset = error.offset; |
+ if (errorOffset > updateOffset) { |
+ error.offset += updateDelta; |
+ } |
+ } |
+ } |
+ } |
+ |
void _shiftTokens(Token token) { |
while (token != null) { |
if (token.offset > updateOffset) { |