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

Side by Side Diff: pkg/analyzer/test/src/summary/resynthesize_test.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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library test.src.serialization.elements_test; 5 library test.src.serialization.elements_test;
6 6
7 import 'dart:convert'; 7 import 'dart:convert';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/constant/value.dart'; 10 import 'package:analyzer/dart/constant/value.dart';
(...skipping 3313 matching lines...) Expand 10 before | Expand all | Expand 10 after
3324 checkLibrary('typedef int F(String s);' 3324 checkLibrary('typedef int F(String s);'
3325 ' class C extends D { var v; }' 3325 ' class C extends D { var v; }'
3326 ' abstract class D { F get v; }'); 3326 ' abstract class D { F get v; }');
3327 } 3327 }
3328 3328
3329 test_inferred_type_refers_to_bound_type_param() { 3329 test_inferred_type_refers_to_bound_type_param() {
3330 checkLibrary('class C<T> extends D<int, T> { var v; }' 3330 checkLibrary('class C<T> extends D<int, T> { var v; }'
3331 ' abstract class D<U, V> { Map<V, U> get v; }'); 3331 ' abstract class D<U, V> { Map<V, U> get v; }');
3332 } 3332 }
3333 3333
3334 void test_inferred_type_refers_to_function_typed_param_of_typedef() {
3335 checkLibrary('''
3336 typedef void F(int g(String s));
3337 h(F f) => null;
3338 var v = h(/*info:INFERRED_TYPE_CLOSURE*/(y) {});
3339 ''');
3340 }
3341
3334 test_inferred_type_refers_to_function_typed_parameter_type_generic_class() { 3342 test_inferred_type_refers_to_function_typed_parameter_type_generic_class() {
3335 checkLibrary('class C<T, U> extends D<U, int> { void f(int x, g) {} }' 3343 checkLibrary('class C<T, U> extends D<U, int> { void f(int x, g) {} }'
3336 ' abstract class D<V, W> { void f(int x, W g(V s)); }'); 3344 ' abstract class D<V, W> { void f(int x, W g(V s)); }');
3337 } 3345 }
3338 3346
3339 test_inferred_type_refers_to_function_typed_parameter_type_other_lib() { 3347 test_inferred_type_refers_to_function_typed_parameter_type_other_lib() {
3340 addLibrarySource( 3348 addLibrarySource(
3341 '/a.dart', 'import "b.dart"; abstract class D extends E {}'); 3349 '/a.dart', 'import "b.dart"; abstract class D extends E {}');
3342 addLibrarySource( 3350 addLibrarySource(
3343 '/b.dart', 'abstract class E { void f(int x, int g(String s)); }'); 3351 '/b.dart', 'abstract class E { void f(int x, int g(String s)); }');
(...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after
4386 fail('Unexpectedly tried to get unlinked summary for $uri'); 4394 fail('Unexpectedly tried to get unlinked summary for $uri');
4387 } 4395 }
4388 return serializedUnit; 4396 return serializedUnit;
4389 } 4397 }
4390 4398
4391 @override 4399 @override
4392 bool hasLibrarySummary(String uri) { 4400 bool hasLibrarySummary(String uri) {
4393 return true; 4401 return true;
4394 } 4402 }
4395 } 4403 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/summary/summarize_elements.dart ('k') | pkg/analyzer/test/src/summary/summarize_ast_strong_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698