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

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

Issue 1960933002: Fix AST summarization of synthetic function types and method tear-offs. (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
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 a46b74120b978a42d0030e8e4685aa2babf95661..ccd2deb19e500377d5b7e3c9a893b292007a813f 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_test.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_test.dart
@@ -658,7 +658,13 @@ abstract class AbstractResynthesizeTest extends AbstractSingleUnitTest {
}
expect(original, isNotNull);
expect(resynthesized, isNotNull, reason: desc);
- expect(rImpl.runtimeType, oImpl.runtimeType);
+ if (rImpl is DefaultParameterElementImpl && oImpl is ParameterElementImpl) {
+ // This is ok provided the resynthesized parameter element doesn't have
+ // any evaluation result.
+ expect(rImpl.evaluationResult, isNull);
+ } else {
+ expect(rImpl.runtimeType, oImpl.runtimeType);
+ }
expect(resynthesized.kind, original.kind);
expect(resynthesized.location, original.location, reason: desc);
expect(resynthesized.name, original.name);
@@ -3226,6 +3232,14 @@ Stream s;
checkLibrary('import "a.dart"; import "b.dart"; C c; D d;');
}
+ void test_inferedType_usesSyntheticFunctionType_functionTypedParam() {
+ checkLibrary('''
+int f(int x(String y)) => null;
+String g(int x(String y)) => null;
+var v = [f, g];
+''');
+ }
+
test_inferred_function_type_for_variable_in_generic_function() {
// In the code below, `x` has an inferred type of `() => int`, with 2
// (unused) type parameters from the enclosing top level function.
« no previous file with comments | « pkg/analyzer/lib/src/summary/resynthesize.dart ('k') | pkg/analyzer/test/src/task/strong/inferred_type_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698