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

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

Issue 2965023002: Fix inference test expectations for generic function types. (Closed)
Patch Set: Created 3 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/front_end/testcases/inference/downwards_inference_annotations_type_variable_local.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/task/strong/front_end_inference_test.dart
diff --git a/pkg/analyzer/test/src/task/strong/front_end_inference_test.dart b/pkg/analyzer/test/src/task/strong/front_end_inference_test.dart
index 7192b59a5737674e7621eebb7d0c0f4928b6b3cd..df4d37210a3b7013d25138c70dc747fae9d50ec6 100644
--- a/pkg/analyzer/test/src/task/strong/front_end_inference_test.dart
+++ b/pkg/analyzer/test/src/task/strong/front_end_inference_test.dart
@@ -279,7 +279,7 @@ class _InstrumentationValueForType extends fasta.InstrumentationValue {
void _appendType(StringBuffer buffer, DartType type) {
if (type is FunctionType) {
if (type.typeFormals.isNotEmpty) {
- _appendTypeArguments(buffer, type.typeArguments);
+ _appendTypeFormals(buffer, type.typeFormals);
}
_appendParameters(buffer, type.parameters);
buffer.write(' -> ');
@@ -301,6 +301,20 @@ class _InstrumentationValueForType extends fasta.InstrumentationValue {
_appendList<DartType>(buffer, '<', '>', typeArguments, ', ',
(type) => _appendType(buffer, type));
}
+
+ void _appendTypeFormals(
+ StringBuffer buffer, List<TypeParameterElement> typeFormals) {
+ _appendList<TypeParameterElement>(buffer, '<', '>', typeFormals, ', ',
+ (formal) {
+ buffer.write(formal.name);
+ buffer.write(' extends ');
+ if (formal.bound == null) {
+ buffer.write('Object');
+ } else {
+ _appendType(buffer, formal.bound);
+ }
+ });
+ }
}
/**
« no previous file with comments | « no previous file | pkg/front_end/testcases/inference/downwards_inference_annotations_type_variable_local.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698