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

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

Issue 1961533002: Fix summarization of inferred types which are function-typed params of typedefs. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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_strong_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 586cbfb08de5dd2dd7695a44bdfccb1636f9944f..23571cc07865ad7a14ea4c7f3e335be1ca7a6a6b 100644
--- a/pkg/analyzer/test/src/summary/summary_common.dart
+++ b/pkg/analyzer/test/src/summary/summary_common.dart
@@ -7580,6 +7580,26 @@ class D extends p.C {} // Prevent "unused import" warning
checkLinkedTypeRef(type.typeArguments[1], 'dart:core', 'dart:core', 'int');
}
+ test_inferred_type_refers_to_function_typed_param_of_typedef() {
+ if (!strongMode || skipFullyLinkedData) {
+ return;
+ }
+ UnlinkedVariable v = serializeVariableText('''
+typedef void F(int g(String s));
+h(F f) => null;
+var v = h((y) {});
+''');
+ expect(v.initializer.localFunctions, hasLength(1));
+ UnlinkedExecutable closure = v.initializer.localFunctions[0];
+ expect(closure.parameters, hasLength(1));
+ UnlinkedParam y = closure.parameters[0];
+ expect(y.name, 'y');
+ EntityRef typeRef = getTypeRefForSlot(y.inferredTypeSlot);
+ checkLinkedTypeRef(typeRef, null, null, 'F',
+ expectedKind: ReferenceKind.typedef);
+ expect(typeRef.implicitFunctionTypeIndices, [0]);
+ }
+
test_inferred_type_refers_to_function_typed_parameter_type_generic_class() {
if (!strongMode || skipFullyLinkedData) {
return;
« no previous file with comments | « pkg/analyzer/test/src/summary/summarize_ast_strong_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698