From 573c0068766e6da82f89e32e2eca973284bda313 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Fri, 16 Dec 2022 00:35:03 +0000 Subject: [PATCH] Helpers.argList allow check for empty list --- kiss/src/kiss/Helpers.hx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kiss/src/kiss/Helpers.hx b/kiss/src/kiss/Helpers.hx index 8b206c62..d23abebd 100644 --- a/kiss/src/kiss/Helpers.hx +++ b/kiss/src/kiss/Helpers.hx @@ -705,8 +705,12 @@ class Helpers { }; } - public static function argList(exp:ReaderExp, forThis:String):Array { + public static function argList(exp:ReaderExp, forThis:String, allowEmpty = true):Array { return switch (exp.def) { + case ListExp([]) if (allowEmpty): + []; + case ListExp([]) if (!allowEmpty): + throw KissError.fromExp(exp, 'arg list for $forThis must not be empty'); case ListExp(argExps): argExps; default: