From dbb716d26d82ab8fbe44601f4af2ad9873d1dc1c Mon Sep 17 00:00:00 2001 From: Peter Mikkelsen Date: Sat, 12 Feb 2022 14:06:30 +0000 Subject: Handle prototypes a bit better, but I suspect not everywhere --- array.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'array.c') diff --git a/array.c b/array.c index f97ac5c..a46668b 100644 --- a/array.c +++ b/array.c @@ -191,7 +191,7 @@ arrayitem(Array *a, int index) case AtypeFloat: res = mkscalarfloat(a->mixeddata[index].f); break; case AtypeRune: res = mkscalarrune(a->mixeddata[index].r); break; default: - throwerror(L"Unhandled case in arrayitem", ENotImplemented); + throwerror(L"Unhandled case in arrayitem 1", ENotImplemented); } break; case AtypeArray: @@ -199,7 +199,7 @@ arrayitem(Array *a, int index) incarrayref(res); break; default: - throwerror(L"Unhandled case in arrayitem", ENotImplemented); + throwerror(L"Unhandled case in arrayitem 2", ENotImplemented); } return res; } @@ -351,6 +351,8 @@ fillelement(Array *a) return fill; } case AtypeArray:{ + if(GetSize(a) == 0) + return fnSame(a->prototype); Array *b = duparrayshape(a, GetType(a)); for(int i = 0; i < GetSize(b); i++){ Array *fill = fillelement(a->arraydata[i]); -- cgit v1.2.3