Browse Source

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

bjorn 3 years ago
parent
commit
b12d2ad0b3
1 changed files with 2 additions and 0 deletions
  1. 2 0
      api/main.lua

+ 2 - 0
api/main.lua

@@ -95,6 +95,8 @@ local function processFunction(path, parent)
   end
   end
 
 
   if not fn.variants then
   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 = {
     fn.variants = {
       {
       {
         arguments = fn.arguments,
         arguments = fn.arguments,