Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(771)

Unified Diff: pkg/analyzer/lib/src/generated/incremental_resolver.dart

Issue 1606103003: Issue 25515. Don't incrementally resolve if a constructor initializer is changed. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/incremental_resolver_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3f756eaa8c01d5a3ecf9d9c6d01ab69d898f9d36..80983360d662f3c5015876f9100d93a858e2895a 100644
--- a/pkg/analyzer/lib/src/generated/incremental_resolver.dart
+++ b/pkg/analyzer/lib/src/generated/incremental_resolver.dart
@@ -1470,6 +1470,13 @@ class PoorMansIncrementalResolver {
{
List<AstNode> oldParents = _getParents(oldNode);
List<AstNode> newParents = _getParents(newNode);
+ // fail if an initializer change
+ if (oldParents.any((n) => n is ConstructorInitializer) ||
+ newParents.any((n) => n is ConstructorInitializer)) {
+ logger.log('Failure: a change in a constructor initializer');
+ return false;
+ }
+ // find matching methods / bodies
int length = math.min(oldParents.length, newParents.length);
bool found = false;
for (int i = 0; i < length; i++) {
@@ -1507,11 +1514,6 @@ class PoorMansIncrementalResolver {
} else {
return false;
}
- } else if (oldParent is ConstructorInitializer ||
- newParent is ConstructorInitializer) {
- logger.log('Failure: changes in constant constructor initializers'
- ' may cause external changes in constant objects.');
- return false;
} else if (oldParent is FunctionBody && newParent is FunctionBody) {
if (oldParent is BlockFunctionBody &&
newParent is BlockFunctionBody) {
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/incremental_resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698