Browse Source

Warn if variants are missing for a function with named arguments/returns;

bjorn 3 năm trước cách đây
mục cha
commit
b12d2ad0b3
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 2 0
      api/main.lua

+ 2 - 0
api/main.lua

@@ -95,6 +95,8 @@ local function processFunction(path, parent)
   end
 
   if not fn.variants then
+    local missingVariants = (not fn.arguments[1] and next(fn.arguments)) or (not fn.returns[1] and next(fn.returns))
+    warnIf(missingVariants, 'Function %q is missing variants', fn.key)
     fn.variants = {
       {
         arguments = fn.arguments,