From e89d59c60645f0b94e73965084c419c26a19c31e Mon Sep 17 00:00:00 2001 From: dzaima Date: Sun, 4 Feb 2024 23:27:28 +0200 Subject: [PATCH] more proper error message --- src/ffi.c | 2 +- test/cases/ffi.bqn | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ffi.c b/src/ffi.c index 451c67f0..dbbcad7d 100644 --- a/src/ffi.c +++ b/src/ffi.c @@ -661,7 +661,7 @@ void genObj(B o, B c, bool anyMut, void* ptr) { // doesn't consume B e = t->a[0].o; if (!isArr(c)) { if (isC32(e)) thrF("FFI: Expected array corresponding to \"*%S\"", sty_names[o2cG(e)]); - else thrM("FFI: Expected array corresponding to *{...}"); + else thrM("FFI: Expected array corresponding to *..."); } usz ia = IA(c); if (t->ty==cty_tlarr && t->arrCount!=ia) thrF("FFI: Incorrect item count of %s corresponding to \"[%s]...\"", ia, (usz)t->arrCount); diff --git a/test/cases/ffi.bqn b/test/cases/ffi.bqn index 940d8b6a..2541c598 100644 --- a/test/cases/ffi.bqn +++ b/test/cases/ffi.bqn @@ -130,7 +130,8 @@ # wrong argument internal structure -!"FFI: Expected array corresponding to *{...}" % f←@•FFI""‿"bqn_init"‿">*{i32}" ⋄ F @ +!"FFI: Expected array corresponding to *..." % f←@•FFI""‿"bqn_init"‿">*[2]i32" ⋄ F @ +!"FFI: Expected array corresponding to *..." % f←@•FFI""‿"bqn_init"‿">*{i32}" ⋄ F @ !"FFI: Expected array corresponding to a struct" % f←@•FFI""‿"bqn_init"‿">{i32}" ⋄ F @ !"FFI: Expected array corresponding to a struct" % f←@•FFI""‿"bqn_init"‿">*{i32}" ⋄ F ⟨@⟩ !"FFI: Incorrect list length corresponding to a struct: expected 1, got 0" % f←@•FFI""‿"bqn_init"‿">*{i32}" ⋄ F ⟨⟨⟩⟩