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

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

Issue 2848033002: Don't include parameter names in types, don't use Unicode arrow. (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/testcases/inference/async_closure_return_type_flatten.dart » ('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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 first = false; 156 first = false;
157 } 157 }
158 buffer.write(close); 158 buffer.write(close);
159 } 159 }
160 160
161 void _appendParameters( 161 void _appendParameters(
162 StringBuffer buffer, List<ParameterElement> parameters) { 162 StringBuffer buffer, List<ParameterElement> parameters) {
163 _appendList<ParameterElement>(buffer, '(', ')', parameters, ', ', 163 _appendList<ParameterElement>(buffer, '(', ')', parameters, ', ',
164 (parameter) { 164 (parameter) {
165 _appendType(buffer, parameter.type); 165 _appendType(buffer, parameter.type);
166 buffer.write(' ');
167 buffer.write(parameter.name);
168 }, includeEmpty: true); 166 }, includeEmpty: true);
169 } 167 }
170 168
171 void _appendType(StringBuffer buffer, DartType type) { 169 void _appendType(StringBuffer buffer, DartType type) {
172 if (type is FunctionType) { 170 if (type is FunctionType) {
173 Element element = type.element; 171 Element element = type.element;
174 _appendElementName(buffer, element); 172 _appendElementName(buffer, element);
175 _appendTypeArguments(buffer, type.typeArguments); 173 _appendTypeArguments(buffer, type.typeArguments);
176 _appendParameters(buffer, type.parameters); 174 _appendParameters(buffer, type.parameters);
177 buffer.write(' '); 175 buffer.write(' -> ');
178 _appendType(buffer, type.returnType); 176 _appendType(buffer, type.returnType);
179 } else if (type is InterfaceType) { 177 } else if (type is InterfaceType) {
180 ClassElement element = type.element; 178 ClassElement element = type.element;
181 _appendElementName(buffer, element); 179 _appendElementName(buffer, element);
182 _appendTypeArguments(buffer, type.typeArguments); 180 _appendTypeArguments(buffer, type.typeArguments);
183 } else { 181 } else {
184 buffer.write(type.toString()); 182 buffer.write(type.toString());
185 } 183 }
186 } 184 }
187 185
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 void _recordType(int offset, DartType type) { 299 void _recordType(int offset, DartType type) {
302 _instrumentation.record( 300 _instrumentation.record(
303 uri, offset, 'type', new _InstrumentationValueForType(type)); 301 uri, offset, 'type', new _InstrumentationValueForType(type));
304 } 302 }
305 303
306 void _recordTypeArguments(int offset, List<DartType> typeArguments) { 304 void _recordTypeArguments(int offset, List<DartType> typeArguments) {
307 _instrumentation.record(uri, offset, 'typeArgs', 305 _instrumentation.record(uri, offset, 'typeArgs',
308 new _InstrumentationValueForTypeArgs(typeArguments)); 306 new _InstrumentationValueForTypeArgs(typeArguments));
309 } 307 }
310 } 308 }
OLDNEW
« no previous file with comments | « no previous file | pkg/front_end/testcases/inference/async_closure_return_type_flatten.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698