From 1bcf6bdc9a2652366bc152a1d98524743623bdf5 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sat, 17 Feb 2024 17:35:16 -0500 Subject: Add cord methods for getting typestrings --- builtins/array.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'builtins/array.c') diff --git a/builtins/array.c b/builtins/array.c index d2c5444e..249281ce 100644 --- a/builtins/array.c +++ b/builtins/array.c @@ -271,6 +271,9 @@ public bool Array_equal(const array_t *x, const array_t *y, const TypeInfo *type public CORD Array_cord(const array_t *arr, bool colorize, const TypeInfo *type) { + if (!arr) + return CORD_all("[", generic_cord(NULL, false, type->ArrayInfo.item), "]"); + TypeInfo *item_type = type->ArrayInfo.item; CORD c = "["; for (int64_t i = 0; i < arr->length; i++) { -- cgit v1.2.3