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 74ad8219e05b2683352202b8690fbf19b21891e3..f1090176365999b6d42309b086033ffb9db849e5 100644 |
--- a/pkg/analyzer/lib/src/generated/incremental_resolver.dart |
+++ b/pkg/analyzer/lib/src/generated/incremental_resolver.dart |
@@ -8,7 +8,7 @@ import 'dart:collection'; |
import 'dart:math' as math; |
import 'package:analyzer/src/context/cache.dart' |
- show CacheEntry, Delta, DeltaResult, TargetedResult; |
+ show CacheEntry, Delta, DeltaResult; |
import 'package:analyzer/src/generated/constant.dart'; |
import 'package:analyzer/src/task/dart.dart'; |
import 'package:analyzer/task/dart.dart'; |
@@ -857,6 +857,12 @@ class IncrementalBodyDelta extends Delta { |
@override |
DeltaResult validate(InternalAnalysisContext context, AnalysisTarget target, |
ResultDescriptor descriptor) { |
+ // A body change delta should never leak outside its source. |
+ // It can cause invalidation of results (e.g. hints) in other sources, |
+ // but only when a result in the updated source is INVALIDATE_NO_DELTA. |
+ if (target.source != source) { |
+ return DeltaResult.STOP; |
+ } |
// don't invalidate results of standard Dart tasks |
bool isByTask(TaskDescriptor taskDescriptor) { |
return taskDescriptor.results.contains(descriptor); |