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

Side by Side Diff: pkg/analyzer/test/src/task/strong/front_end_inference_test.dart

Issue 2875103002: Exclude function name from function type annotations in front end type inference tests. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « no previous file | pkg/front_end/test/fasta/strong.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:convert'; 6 import 'dart:convert';
7 import 'dart:io'; 7 import 'dart:io';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/visitor.dart'; 10 import 'package:analyzer/dart/ast/visitor.dart';
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 void _appendParameters( 190 void _appendParameters(
191 StringBuffer buffer, List<ParameterElement> parameters) { 191 StringBuffer buffer, List<ParameterElement> parameters) {
192 _appendList<ParameterElement>(buffer, '(', ')', parameters, ', ', 192 _appendList<ParameterElement>(buffer, '(', ')', parameters, ', ',
193 (parameter) { 193 (parameter) {
194 _appendType(buffer, parameter.type); 194 _appendType(buffer, parameter.type);
195 }, includeEmpty: true); 195 }, includeEmpty: true);
196 } 196 }
197 197
198 void _appendType(StringBuffer buffer, DartType type) { 198 void _appendType(StringBuffer buffer, DartType type) {
199 if (type is FunctionType) { 199 if (type is FunctionType) {
200 Element element = type.element;
201 _appendElementName(buffer, element);
202 _appendTypeArguments(buffer, type.typeArguments); 200 _appendTypeArguments(buffer, type.typeArguments);
203 _appendParameters(buffer, type.parameters); 201 _appendParameters(buffer, type.parameters);
204 buffer.write(' -> '); 202 buffer.write(' -> ');
205 _appendType(buffer, type.returnType); 203 _appendType(buffer, type.returnType);
206 } else if (type is InterfaceType) { 204 } else if (type is InterfaceType) {
207 ClassElement element = type.element; 205 ClassElement element = type.element;
208 _appendElementName(buffer, element); 206 _appendElementName(buffer, element);
209 _appendTypeArguments(buffer, type.typeArguments); 207 _appendTypeArguments(buffer, type.typeArguments);
210 } else { 208 } else {
211 buffer.write(type.toString()); 209 buffer.write(type.toString());
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 393
396 /// Based on DDC code generator's `_recoverTypeArguments` 394 /// Based on DDC code generator's `_recoverTypeArguments`
397 Iterable<DartType> _recoverTypeArguments(FunctionType g, FunctionType f) { 395 Iterable<DartType> _recoverTypeArguments(FunctionType g, FunctionType f) {
398 assert(identical(g.element, f.element)); 396 assert(identical(g.element, f.element));
399 assert(g.typeFormals.isNotEmpty && f.typeFormals.isEmpty); 397 assert(g.typeFormals.isNotEmpty && f.typeFormals.isEmpty);
400 assert(g.typeFormals.length + g.typeArguments.length == 398 assert(g.typeFormals.length + g.typeArguments.length ==
401 f.typeArguments.length); 399 f.typeArguments.length);
402 return f.typeArguments.skip(g.typeArguments.length); 400 return f.typeArguments.skip(g.typeArguments.length);
403 } 401 }
404 } 402 }
OLDNEW
« no previous file with comments | « no previous file | pkg/front_end/test/fasta/strong.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698