Fix several inferred type summary tests.

These tests were relying on some details of the summary representation
that are no longer present, namely the fact that function elements
appearing within initializers (including the synthetic function
element for an initializer) used to have inferred types associated
with them.  The tests have been changed so that they exercise the same
functionality, but they use the inferred type of the variable directly
rather than going through the function elements.

Change-Id: I8e7733674bfa6f8e7f442ea04e7da702f3b11020
Reviewed-on: https://dart-review.googlesource.com/74922
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
diff --git a/pkg/analyzer/test/src/summary/summarize_ast_one_phase_test.dart b/pkg/analyzer/test/src/summary/summarize_ast_one_phase_test.dart
index 65d5377..7aa8ea8 100644
--- a/pkg/analyzer/test/src/summary/summarize_ast_one_phase_test.dart
+++ b/pkg/analyzer/test/src/summary/summarize_ast_one_phase_test.dart
@@ -42,24 +42,6 @@
 
   @override
   @failingTest
-  test_inferred_type_refers_to_function_typed_param_of_typedef() {
-    super.test_inferred_type_refers_to_function_typed_param_of_typedef();
-  }
-
-  @override
-  @failingTest
-  test_inferred_type_refers_to_nested_function_typed_param() {
-    super.test_inferred_type_refers_to_nested_function_typed_param();
-  }
-
-  @override
-  @failingTest
-  test_inferred_type_refers_to_nested_function_typed_param_named() {
-    super.test_inferred_type_refers_to_nested_function_typed_param_named();
-  }
-
-  @override
-  @failingTest
   test_initializer_executable_with_bottom_return_type() {
     super.test_initializer_executable_with_bottom_return_type();
   }
diff --git a/pkg/analyzer/test/src/summary/summarize_ast_strong_test.dart b/pkg/analyzer/test/src/summary/summarize_ast_strong_test.dart
index cb6268c..b83b616 100644
--- a/pkg/analyzer/test/src/summary/summarize_ast_strong_test.dart
+++ b/pkg/analyzer/test/src/summary/summarize_ast_strong_test.dart
@@ -36,24 +36,6 @@
 
   @override
   @failingTest
-  test_inferred_type_refers_to_function_typed_param_of_typedef() {
-    super.test_inferred_type_refers_to_function_typed_param_of_typedef();
-  }
-
-  @override
-  @failingTest
-  test_inferred_type_refers_to_nested_function_typed_param() {
-    super.test_inferred_type_refers_to_nested_function_typed_param();
-  }
-
-  @override
-  @failingTest
-  test_inferred_type_refers_to_nested_function_typed_param_named() {
-    super.test_inferred_type_refers_to_nested_function_typed_param_named();
-  }
-
-  @override
-  @failingTest
   test_initializer_executable_with_bottom_return_type() {
     super.test_initializer_executable_with_bottom_return_type();
   }
diff --git a/pkg/analyzer/test/src/summary/summary_common.dart b/pkg/analyzer/test/src/summary/summary_common.dart
index bdc8900..daac93b 100644
--- a/pkg/analyzer/test/src/summary/summary_common.dart
+++ b/pkg/analyzer/test/src/summary/summary_common.dart
@@ -7742,15 +7742,10 @@
     }
     UnlinkedVariable v = serializeVariableText('''
 typedef void F(int g(String s));
-h(F f) => null;
-var v = h((y) {});
+F h() => null;
+var v = h();
 ''');
-    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);
+    EntityRef typeRef = getTypeRefForSlot(v.inferredTypeSlot);
     checkLinkedTypeRef(typeRef, null, 'F', expectedKind: ReferenceKind.typedef);
     expect(typeRef.implicitFunctionTypeIndices, isEmpty);
   }
@@ -7827,15 +7822,11 @@
       return;
     }
     UnlinkedVariable v = serializeVariableText('''
-f(void g(int x, void h())) => null;
-var v = f((x, y) {});
+dynamic f(void g(int x, void h())) => null;
+T extract<T>(dynamic f2(void g2(int x2, T h2)) => null;
+var v = extract(f);
 ''');
-    expect(v.initializer.localFunctions, hasLength(1));
-    UnlinkedExecutable closure = v.initializer.localFunctions[0];
-    expect(closure.parameters, hasLength(2));
-    UnlinkedParam y = closure.parameters[1];
-    expect(y.name, 'y');
-    EntityRef typeRef = getTypeRefForSlot(y.inferredTypeSlot);
+    EntityRef typeRef = getTypeRefForSlot(v.inferredTypeSlot);
     checkLinkedTypeRef(typeRef, null, 'f',
         expectedKind: ReferenceKind.topLevelFunction);
     expect(typeRef.implicitFunctionTypeIndices, [0, 1]);
@@ -7846,15 +7837,11 @@
       return;
     }
     UnlinkedVariable v = serializeVariableText('''
-f({void g(int x, void h())}) => null;
-var v = f(g: (x, y) {});
+dynamic f({void g(int x, void h())}) => null;
+T extract<T>(dynamic f2({void g(int x2, T h2)})) => null;
+var v = extract(f);
 ''');
-    expect(v.initializer.localFunctions, hasLength(1));
-    UnlinkedExecutable closure = v.initializer.localFunctions[0];
-    expect(closure.parameters, hasLength(2));
-    UnlinkedParam y = closure.parameters[1];
-    expect(y.name, 'y');
-    EntityRef typeRef = getTypeRefForSlot(y.inferredTypeSlot);
+    EntityRef typeRef = getTypeRefForSlot(v.inferredTypeSlot);
     checkLinkedTypeRef(typeRef, null, 'f',
         expectedKind: ReferenceKind.topLevelFunction);
     expect(typeRef.implicitFunctionTypeIndices, [0, 1]);