Index: pkg/analyzer/lib/src/task/incremental_element_builder.dart |
diff --git a/pkg/analyzer/lib/src/task/incremental_element_builder.dart b/pkg/analyzer/lib/src/task/incremental_element_builder.dart |
index abd306798383df8b047545d96ef73893ad5249ce..d20ce0bbc37e97abb74d04e1072ca9e05ad5e558 100644 |
--- a/pkg/analyzer/lib/src/task/incremental_element_builder.dart |
+++ b/pkg/analyzer/lib/src/task/incremental_element_builder.dart |
@@ -163,6 +163,12 @@ class IncrementalCompilationUnitElementBuilder { |
new ConstantFinder(unitElement.context, unitSource, librarySource); |
oldUnit.accept(finder); |
unitConstants.addAll(finder.constantsToCompute); |
+ // Update annotation constants to using the old unit element. |
+ for (ConstantEvaluationTarget constant in unitConstants) { |
+ if (constant is ElementAnnotationImpl) { |
+ constant.compilationUnit = unitElement; |
+ } |
+ } |
} |
ClassElementDelta _processClassMembers( |