aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/pprint.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/pprint.cpp b/src/pprint.cpp
index e83c089..be0a840 100644
--- a/src/pprint.cpp
+++ b/src/pprint.cpp
@@ -146,9 +146,13 @@ print_to(ostream& out, const AST* ast, unsigned indent, CEnv* cenv, bool types)
out << "(" << (*i++) << " ";
const ATuple* const fn = tup->frrst()->as_tuple();
const ATuple* const prot = fn->frst()->as_tuple();
- const ATuple* const fnT = cenv->type(fn)->as_tuple();
- print_list_one_line(out, prot, prot->begin(), indent + 7, cenv, types, fnT->prot());
- print_annotation(out, fn->list_last(), indent + head_width + 1, cenv, types);
+ if (types) {
+ const ATuple* const fnT = cenv->type(fn)->as_tuple();
+ print_list_one_line(out, prot, prot->begin(), indent + 7, cenv, types, fnT->prot());
+ print_annotation(out, fn->list_last(), indent + head_width + 1, cenv, types);
+ } else {
+ print_list_one_line(out, prot, prot->begin(), indent + 7, cenv, types, NULL);
+ }
newline(out, indent + 2);
print_list(out, fn, fn->iter_at(2), indent + 2, cenv, types, false);