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

Unified Diff: pkg/analyzer/test/src/context/context_test.dart

Issue 2199903002: Create synthetic FieldElement(s) (don't use non-synthetic ones) for non-synthetic class getters/set… (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 8c13cf569645406e1f213248c0d45fa8cc6ae762..749edcee66eeb2a852f596956dfd09c8d1f05bc4 100644
--- a/pkg/analyzer/test/src/context/context_test.dart
+++ b/pkg/analyzer/test/src/context/context_test.dart
@@ -3927,6 +3927,40 @@ const A = 2;
_assertInvalid(d, LIBRARY_ERRORS_READY);
}
+ void test_sequence_duplicateField_syntheticAndNot_renameNotSynthetic() {
+ context.analysisOptions =
+ new AnalysisOptionsImpl.from(context.analysisOptions)
+ ..strongMode = true;
+ Source a = addSource(
+ '/a.dart',
+ r'''
+class A {
+ int foo;
+ int get foo => 1;
+}
+class B extends A {
+ int get foo => 2;
+}
+''');
+ _performPendingAnalysisTasks();
+ expect(context.getErrors(a).errors, hasLength(2));
+ // Update a.dart: rename "int foo" to "int bar".
+ // The strong mode "getter cannot override field" error is gone.
+ context.setContents(
+ a,
+ r'''
+class A {
+ int bar;
+ int get foo => 1;
+}
+class B extends A {
+ int get foo => 2;
+}
+''');
+ _performPendingAnalysisTasks();
+ expect(context.getErrors(a).errors, isEmpty);
+ }
+
void test_sequence_inBodyChange_addRef_deltaChange() {
Source a = addSource(
'/a.dart',
« no previous file with comments | « pkg/analyzer/test/generated/all_the_rest_test.dart ('k') | pkg/analyzer/test/src/task/incremental_element_builder_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698