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

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

Issue 1852883003: Fix summarizing of types with unused type parameters. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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/summarize_ast_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_common.dart
diff --git a/pkg/analyzer/test/src/summary/summary_common.dart b/pkg/analyzer/test/src/summary/summary_common.dart
index 5b7ebd22174aab7925d845ceeb49d1573f39921e..87406cc704e394ae5310ca9f3a296708ed7af1ef 100644
--- a/pkg/analyzer/test/src/summary/summary_common.dart
+++ b/pkg/analyzer/test/src/summary/summary_common.dart
@@ -7953,6 +7953,24 @@ typedef F();''';
expect(xType.reference, yType.reference);
}
+ test_unused_type_parameter() {
+ if (skipFullyLinkedData) {
+ return;
+ }
+ // Unused type parameters get converted to `dynamic`.
+ UnlinkedVariable variable = serializeVariableText('''
+class C<T> {
+ void f() {}
+}
+C<int> c;
+var v = c.f;
+''');
+ EntityRef type =
+ getTypeRefForSlot(variable.initializer.inferredReturnTypeSlot);
+ expect(type.typeArguments, hasLength(1));
+ checkLinkedTypeRef(type.typeArguments[0], null, null, 'dynamic');
+ }
+
test_variable() {
String text = 'int i;';
UnlinkedVariable v = serializeVariableText(text, variableName: 'i');
« no previous file with comments | « pkg/analyzer/test/src/summary/summarize_ast_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698