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

Side by Side Diff: pkg/analyzer/test/src/summary/resynthesize_common.dart

Issue 2990783002: Serialize typedef parameters (including function typed ones) to Kernel and use it to resynthesize t… (Closed)
Patch Set: Test for named parameters. Created 3 years, 4 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:async'; 7 import 'dart:async';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; 10 import 'package:analyzer/dart/ast/standard_resolution_map.dart';
(...skipping 9417 matching lines...) Expand 10 before | Expand all | Expand 10 after
9428 '''); 9428 ''');
9429 } 9429 }
9430 9430
9431 test_typedef_parameters() async { 9431 test_typedef_parameters() async {
9432 var library = await checkLibrary('typedef F(x, y);'); 9432 var library = await checkLibrary('typedef F(x, y);');
9433 checkElementText(library, r''' 9433 checkElementText(library, r'''
9434 typedef dynamic F(dynamic x, dynamic y); 9434 typedef dynamic F(dynamic x, dynamic y);
9435 '''); 9435 ''');
9436 } 9436 }
9437 9437
9438 test_typedef_parameters_named() async {
9439 var library = await checkLibrary('typedef F({y, z, x});');
9440 checkElementText(library, r'''
9441 typedef dynamic F({dynamic y}, {dynamic z}, {dynamic x});
9442 ''');
9443 }
9444
9438 test_typedef_return_type() async { 9445 test_typedef_return_type() async {
9439 var library = await checkLibrary('typedef int F();'); 9446 var library = await checkLibrary('typedef int F();');
9440 checkElementText(library, r''' 9447 checkElementText(library, r'''
9441 typedef int F(); 9448 typedef int F();
9442 '''); 9449 ''');
9443 } 9450 }
9444 9451
9445 test_typedef_return_type_generic() async { 9452 test_typedef_return_type_generic() async {
9446 var library = await checkLibrary('typedef T F<T>();'); 9453 var library = await checkLibrary('typedef T F<T>();');
9447 checkElementText(library, r''' 9454 checkElementText(library, r'''
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
10057 fail('Unexpectedly tried to get unlinked summary for $uri'); 10064 fail('Unexpectedly tried to get unlinked summary for $uri');
10058 } 10065 }
10059 return serializedUnit; 10066 return serializedUnit;
10060 } 10067 }
10061 10068
10062 @override 10069 @override
10063 bool hasLibrarySummary(String uri) { 10070 bool hasLibrarySummary(String uri) {
10064 return true; 10071 return true;
10065 } 10072 }
10066 } 10073 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/dart/element/element.dart ('k') | pkg/analyzer/test/src/summary/resynthesize_kernel_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698