{"record":{"id":"216101036f4a73fa","repo":"xai-org/x-algorithm","slug":"mockpassall-function-expects-1-arguments-but-d-re","errorCode":null,"errorMessage":"MockPassAll function expects 1 arguments but %d received","messagePattern":"MockPassAll function expects 1 arguments but (.+?) received","errorType":"validation","errorClass":"SemanticCheckFailure","httpStatus":null,"severity":"error","filePath":"botmaker/src/java/com/twitter/botmaker/compiler/Compiler.java","lineNumber":1277,"sourceCode":"        );\n      }\n    } catch (Exception e) {\n      throw new SemanticCheckFailure(e);\n    }\n\n    return Constant.UNIT;\n  }\n\n  private ASTNode toMockPassAll(\n      CompilerContext context,\n      String exprText,\n      Tree root) throws SemanticCheckFailure {\n    try {\n      if (root.getChildCount() == 2) {\n        String packageName = toStringConstant(root.getChild(1));\n        context.addMockPackage(packageName);\n      } else {\n        throw new SemanticCheckFailure(\n            String.format(\"MockPassAll function expects 1 arguments but %d received\",\n                root.getChildCount() - 1)\n        );\n      }\n    } catch (Exception e) {\n      throw new SemanticCheckFailure(e);\n    }\n\n    return Constant.UNIT;\n  }\n\n  private ASTNode toTestRun(\n      CompilerContext context,\n      String exprText,\n      Tree root) throws SemanticCheckFailure {\n    try {\n\n      if (root.getChildCount() != 2) {","sourceCodeStart":1259,"sourceCodeEnd":1295,"githubUrl":"https://github.com/xai-org/x-algorithm/blob/24c60942c5c5fdad3a6addffb4c6e6d2f228f04f/botmaker/src/java/com/twitter/botmaker/compiler/Compiler.java#L1259-L1295","documentation":"MockPassAll(packageName) takes exactly one string argument naming a package whose function mocks should all be bypassed. Any other argument count is rejected.","triggerScenarios":"`MockPassAll()` with no argument, or `MockPassAll(\"com.a\", \"com.b\")` with multiple packages.","commonSituations":"Attempting to pass multiple packages in one call instead of repeated MockPassAll calls, or omitting the argument in templated test setups.","solutions":["Emit one MockPassAll per package","Ensure the single argument is a quoted package-name string"],"exampleFix":"// before\nMockPassAll(\"com.a\", \"com.b\")\n// after\nMockPassAll(\"com.a\")\nMockPassAll(\"com.b\")","handlingStrategy":"validation","validationCode":"if (mockPassAllArgs != 1) throw new IllegalArgumentException(\"MockPassAll takes exactly 1 package arg\");","typeGuard":null,"tryCatchPattern":"catch (SemanticCheckFailure e) { if (e.getMessage().contains(\"MockPassAll\")) fixArity(); else throw e; }","preventionTips":["One MockPassAll call per package"],"tags":["botmaker","mockpassall","arity","testing"],"backgroundTag":"function-arity-mismatch","analyzedSha":"24c60942c5c5fdad3a6addffb4c6e6d2f228f04f","analyzedAt":"2026-08-28T11:40:14.686Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}