summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authorPeter Mikkelsen <peter@pmikkelsen.com>2022-02-12 14:06:30 +0000
committerPeter Mikkelsen <peter@pmikkelsen.com>2022-02-12 14:06:30 +0000
commitdbb716d26d82ab8fbe44601f4af2ad9873d1dc1c (patch)
tree0d90a237b289a566b1f0f27cd36ff4df6efe54a0 /array.c
parentc07082b46a0a54b4164be67f8b7d18cd24843030 (diff)
Handle prototypes a bit better, but I suspect not everywhere
Diffstat (limited to 'array.c')
-rw-r--r--array.c6
1 files changed, 4 insertions, 2 deletions
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]);