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

Unified Diff: pkg/analyzer/test/src/context/context_test.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 side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/test/src/context/context_test.dart
diff --git a/pkg/analyzer/test/src/context/context_test.dart b/pkg/analyzer/test/src/context/context_test.dart
index 2ec73ef24439d17e96e4cf5c4821faafd4476335..e3ade788bf3a1f7049793cea6f33537cc7ddedb6 100644
--- a/pkg/analyzer/test/src/context/context_test.dart
+++ b/pkg/analyzer/test/src/context/context_test.dart
@@ -3092,6 +3092,43 @@ class C {}
expect(context.getErrors(b).errors, hasLength(1));
}
+ void test_sequence_class_removeMethod_overridden() {
+ Source a = addSource(
+ '/a.dart',
+ r'''
+class A {
+ void foo() {}
+}
+''');
+ Source b = addSource(
+ '/b.dart',
+ r'''
+import 'a.dart';
+class B extends A {
+ @override
+ void foo() {}
+}
+''');
+ _performPendingAnalysisTasks();
+ expect(context.getErrors(b).errors, hasLength(0));
+ // Update a.dart: remove add A.foo.
+ // b.dart has a new hint, because B.foo does not override anything
+ context.setContents(
+ a,
+ r'''
+class A {
+}
+''');
+ _assertValidForChangedLibrary(a);
+ _assertInvalid(a, LIBRARY_ERRORS_READY);
+ _assertValidForDependentLibrary(b);
+ _assertInvalid(b, LIBRARY_ERRORS_READY);
+ _assertInvalidUnits(b, RESOLVED_UNIT4);
+
+ _performPendingAnalysisTasks();
+ expect(context.getErrors(b).errors, hasLength(1));
+ }
+
void test_sequence_inBodyChange_addRef_deltaChange() {
Source a = addSource(
'/a.dart',
« no previous file with comments | « pkg/analyzer/lib/src/task/incremental_element_builder.dart ('k') | pkg/analyzer/test/src/dart/element/element_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698