Sfoglia il codice sorgente

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

bjorn 3 anni fa
parent
commit
b12d2ad0b3
1 ha cambiato i file con 2 aggiunte e 0 eliminazioni
  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,