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

Side by Side Diff: pkg/analyzer/lib/src/task/incremental_element_builder.dart

Issue 2136703002: Flush InterfaceTypeImpl cached memebers when ClassElement.version is different. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « pkg/analyzer/lib/src/summary/link.dart ('k') | pkg/analyzer/test/src/context/context_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.src.task.incremental_element_builder; 5 library analyzer.src.task.incremental_element_builder;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/token.dart'; 10 import 'package:analyzer/dart/ast/token.dart';
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 parameterElement.field = newFields[parameterElement.name]; 327 parameterElement.field = newFields[parameterElement.name];
328 } 328 }
329 } 329 }
330 } 330 }
331 } 331 }
332 // Update ClassElement. 332 // Update ClassElement.
333 classElement.accessors = newAccessors; 333 classElement.accessors = newAccessors;
334 classElement.constructors = classElementHolder.constructors; 334 classElement.constructors = classElementHolder.constructors;
335 classElement.fields = newFields.values.toList(); 335 classElement.fields = newFields.values.toList();
336 classElement.methods = classElementHolder.methods; 336 classElement.methods = classElementHolder.methods;
337 classElement.version++;
337 classElementHolder.validate(); 338 classElementHolder.validate();
338 // Ensure at least a default synthetic constructor. 339 // Ensure at least a default synthetic constructor.
339 if (classElement.constructors.isEmpty) { 340 if (classElement.constructors.isEmpty) {
340 ConstructorElementImpl constructor = 341 ConstructorElementImpl constructor =
341 new ConstructorElementImpl.forNode(null); 342 new ConstructorElementImpl.forNode(null);
342 constructor.synthetic = true; 343 constructor.synthetic = true;
343 classElement.constructors = <ConstructorElement>[constructor]; 344 classElement.constructors = <ConstructorElement>[constructor];
344 } 345 }
345 // OK 346 // OK
346 return classDelta; 347 return classDelta;
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 } 695 }
695 } 696 }
696 super.visitElement(element); 697 super.visitElement(element);
697 } 698 }
698 699
699 static bool _isVariableInitializer(Element element) { 700 static bool _isVariableInitializer(Element element) {
700 return element is FunctionElement && 701 return element is FunctionElement &&
701 element.enclosingElement is VariableElement; 702 element.enclosingElement is VariableElement;
702 } 703 }
703 } 704 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/summary/link.dart ('k') | pkg/analyzer/test/src/context/context_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698