Make debug printing of function types more robust.
Sometimes when printing stack states in the outline builder,
a formal in a function type is a FormalParameterBuilder,
and sometimes a formal or the return type is null.
Change-Id: I2bed0baae2a80e894e170a85744e382e763c8944
Reviewed-on: https://dart-review.googlesource.com/58207
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
diff --git a/pkg/front_end/lib/src/fasta/builder/function_type_builder.dart b/pkg/front_end/lib/src/fasta/builder/function_type_builder.dart
index 49bcf07..b266feb 100644
--- a/pkg/front_end/lib/src/fasta/builder/function_type_builder.dart
+++ b/pkg/front_end/lib/src/fasta/builder/function_type_builder.dart
@@ -37,17 +37,17 @@
buffer.write("(");
if (formals != null) {
bool isFirst = true;
- for (TypeBuilder t in formals) {
+ for (dynamic t in formals) {
if (!isFirst) {
buffer.write(", ");
} else {
isFirst = false;
}
- buffer.write(t.fullNameForErrors);
+ buffer.write(t?.fullNameForErrors);
}
}
buffer.write(") -> ");
- buffer.write(returnType.fullNameForErrors);
+ buffer.write(returnType?.fullNameForErrors);
return buffer;
}