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

Unified Diff: pkg/analyzer/test/src/summary/resynthesize_test.dart

Issue 1597893003: Don't include implicit initializing formal types in summaries. (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
Index: pkg/analyzer/test/src/summary/resynthesize_test.dart
diff --git a/pkg/analyzer/test/src/summary/resynthesize_test.dart b/pkg/analyzer/test/src/summary/resynthesize_test.dart
index d847dc51c1711178a0db0ea9390289f8a5e98477..5f4f980030406e0269331a57f93706f45d8427fc 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_test.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_test.dart
@@ -92,8 +92,8 @@ class ResynthTest extends ResolverTestCase {
reason: '$desc fields.length');
for (int i = 0; i < resynthesized.fields.length; i++) {
String name = original.fields[i].name;
- compareFieldElements(resynthesized.getField(name), original.fields[i],
- '$desc.field $name');
+ compareFieldElements(
+ resynthesized.fields[i], original.fields[i], '$desc.field $name');
}
compareTypes(
resynthesized.supertype, original.supertype, '$desc supertype');
@@ -124,18 +124,10 @@ class ResynthTest extends ResolverTestCase {
}
expect(resynthesized.accessors.length, original.accessors.length);
for (int i = 0; i < resynthesized.accessors.length; i++) {
- String name = original.accessors[i].name;
- if (name.endsWith('=')) {
- comparePropertyAccessorElements(
- resynthesized.getSetter(name),
- original.accessors[i],
- '$desc setter ${original.accessors[i].name}');
- } else {
- comparePropertyAccessorElements(
- resynthesized.getGetter(name),
- original.accessors[i],
- '$desc getter ${original.accessors[i].name}');
- }
+ comparePropertyAccessorElements(
+ resynthesized.accessors[i],
+ original.accessors[i],
+ '$desc accessor ${original.accessors[i].name}');
}
expect(resynthesized.methods.length, original.methods.length);
for (int i = 0; i < resynthesized.methods.length; i++) {
@@ -724,6 +716,16 @@ class E {
checkLibrary('class C { dynamic x; C(this.x); }');
}
+ test_class_constructor_field_formal_multiple_matching_fields() {
+ // This is a compile-time error but it should still analyze consistently.
+ checkLibrary('class C { C(this.x); int x; String x; }', allowErrors: true);
+ }
+
+ test_class_constructor_field_formal_no_matching_field() {
+ // This is a compile-time error but it should still analyze consistently.
+ checkLibrary('class C { C(this.x); }', allowErrors: true);
+ }
+
test_class_constructor_field_formal_typed_dynamic() {
checkLibrary('class C { num x; C(dynamic this.x); }');
}
« no previous file with comments | « pkg/analyzer/lib/src/summary/summarize_elements.dart ('k') | pkg/analyzer/test/src/summary/summary_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698