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

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

Issue 2985293002: Add optional FunctionType.positionalParameterNames and use them to resynthesize function-type forma… (Closed)
Patch Set: 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 6738 matching lines...) Expand 10 before | Expand all | Expand 10 after
6749 void f(int x, int g(String s)); 6749 void f(int x, int g(String s));
6750 } 6750 }
6751 '''); 6751 ''');
6752 var library = await checkLibrary(''' 6752 var library = await checkLibrary('''
6753 import 'a.dart'; 6753 import 'a.dart';
6754 class C extends D { 6754 class C extends D {
6755 void f(int x, g) {} 6755 void f(int x, g) {}
6756 } 6756 }
6757 '''); 6757 ''');
6758 if (isStrongMode) { 6758 if (isStrongMode) {
6759 checkElementText(library, r''' 6759 if (isSharedFrontEnd) {
6760 // Front-end copies FunctionType instances, which means that if it has
6761 // parameter names in superclass, then we have names also in the
6762 // subclass.
6763 checkElementText(library, r'''
6764 import 'a.dart';
6765 class C extends D {
6766 void f(int x, int g(String s)) {}
6767 }
6768 ''');
6769 } else {
6770 checkElementText(library, r'''
6760 import 'a.dart'; 6771 import 'a.dart';
6761 class C extends D { 6772 class C extends D {
6762 void f(int x, (String) → int g) {} 6773 void f(int x, (String) → int g) {}
6763 } 6774 }
6764 '''); 6775 ''');
6776 }
6765 } else { 6777 } else {
6766 checkElementText(library, r''' 6778 checkElementText(library, r'''
6767 import 'a.dart'; 6779 import 'a.dart';
6768 class C extends D { 6780 class C extends D {
6769 void f(int x, dynamic g) {} 6781 void f(int x, dynamic g) {}
6770 } 6782 }
6771 '''); 6783 ''');
6772 } 6784 }
6773 } 6785 }
6774 6786
(...skipping 3282 matching lines...) Expand 10 before | Expand all | Expand 10 after
10057 fail('Unexpectedly tried to get unlinked summary for $uri'); 10069 fail('Unexpectedly tried to get unlinked summary for $uri');
10058 } 10070 }
10059 return serializedUnit; 10071 return serializedUnit;
10060 } 10072 }
10061 10073
10062 @override 10074 @override
10063 bool hasLibrarySummary(String uri) { 10075 bool hasLibrarySummary(String uri) {
10064 return true; 10076 return true;
10065 } 10077 }
10066 } 10078 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698