aboutsummaryrefslogtreecommitdiff
path: root/src/debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/debug.c')
-rw-r--r--src/debug.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/debug.c b/src/debug.c
index 47e53f2..92d85d2 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -218,6 +218,22 @@ void internal_warn(const char *fmt, ...)
va_end(args);
}
+static void _type_str(FILE *fp, struct type *type);
+
+static void _type_list_str(FILE *fp, struct type *types)
+{
+ if (!types)
+ return;
+
+ _type_str(fp, types);
+
+ types = types->n;
+ foreach_type(t, types) {
+ fprintf(fp, ", ");
+ _type_str(fp, t);
+ }
+}
+
/**
* Workhorse for type_str().
*
@@ -263,6 +279,15 @@ static void _type_str(FILE *fp, struct type *type)
break;
}
+ case TYPE_CALLABLE: {
+ fputc('(', fp);
+ _type_list_str(fp, callable_ptypes(type));
+ fprintf(fp, " => ");
+ _type_str(fp, callable_rtype(type));
+ fputc(')', fp);
+ break;
+ }
+
default:
if (is_primitive(type))
fprintf(fp, "%s", primitive_str(type));