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

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

Issue 1602263002: Fix summarization of trailing `dynamic` type arguments. (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 | « pkg/analyzer/test/src/summary/resynthesize_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/summary/summary_test.dart
diff --git a/pkg/analyzer/test/src/summary/summary_test.dart b/pkg/analyzer/test/src/summary/summary_test.dart
index b282648316b9189f2a29b5e64282aa27680ba313..6c09674ede97a502ac9ae34e898784f91db57d88 100644
--- a/pkg/analyzer/test/src/summary/summary_test.dart
+++ b/pkg/analyzer/test/src/summary/summary_test.dart
@@ -2788,6 +2788,24 @@ void set f(value) {}''';
expect(typeRef.typeArguments, isEmpty);
}
+ test_type_arguments_explicit_dynamic_dynamic() {
+ UnlinkedTypeRef typeRef = serializeTypeText('Map<dynamic, dynamic>');
+ checkTypeRef(typeRef, 'dart:core', 'dart:core', 'Map',
+ allowTypeParameters: true, numTypeParameters: 2);
+ // Trailing type arguments of type `dynamic` are omitted.
+ expect(typeRef.typeArguments, isEmpty);
+ }
+
+ test_type_arguments_explicit_dynamic_int() {
+ UnlinkedTypeRef typeRef = serializeTypeText('Map<dynamic, int>');
+ checkTypeRef(typeRef, 'dart:core', 'dart:core', 'Map',
+ allowTypeParameters: true, numTypeParameters: 2);
+ // Leading type arguments of type `dynamic` are not omitted.
+ expect(typeRef.typeArguments.length, 2);
+ checkDynamicTypeRef(typeRef.typeArguments[0]);
+ checkTypeRef(typeRef.typeArguments[1], 'dart:core', 'dart:core', 'int');
+ }
+
test_type_arguments_explicit_dynamic_typedef() {
UnlinkedTypeRef typeRef =
serializeTypeText('F<dynamic>', otherDeclarations: 'typedef T F<T>();');
@@ -2798,6 +2816,24 @@ void set f(value) {}''';
expect(typeRef.typeArguments, isEmpty);
}
+ test_type_arguments_explicit_String_dynamic() {
+ UnlinkedTypeRef typeRef = serializeTypeText('Map<String, dynamic>');
+ checkTypeRef(typeRef, 'dart:core', 'dart:core', 'Map',
+ allowTypeParameters: true, numTypeParameters: 2);
+ // Trailing type arguments of type `dynamic` are omitted.
+ expect(typeRef.typeArguments.length, 1);
+ checkTypeRef(typeRef.typeArguments[0], 'dart:core', 'dart:core', 'String');
+ }
+
+ test_type_arguments_explicit_String_int() {
+ UnlinkedTypeRef typeRef = serializeTypeText('Map<String, int>');
+ checkTypeRef(typeRef, 'dart:core', 'dart:core', 'Map',
+ allowTypeParameters: true, numTypeParameters: 2);
+ expect(typeRef.typeArguments.length, 2);
+ checkTypeRef(typeRef.typeArguments[0], 'dart:core', 'dart:core', 'String');
+ checkTypeRef(typeRef.typeArguments[1], 'dart:core', 'dart:core', 'int');
+ }
+
test_type_arguments_explicit_typedef() {
UnlinkedTypeRef typeRef =
serializeTypeText('F<int>', otherDeclarations: 'typedef T F<T>();');
« no previous file with comments | « pkg/analyzer/test/src/summary/resynthesize_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698