NV1004Compiler

Invalid Function Call

A function or method was invoked with an incorrect number of arguments or incompatible argument types.

BREAKPOINT: main.nv:42rax = 0x7ffd9b82rbx = 0x00000001

Why this error occurs

Passing too few or too many arguments to a function, calling a non-callable object, or passing argument types that fail the parameter signature validation.

Incorrect Code
// incorrect: 'add' expects 2 arguments, but 3 are passed
fn add(a: int, b: int) -> int:
    return a + b

let sum = add(10, 20, 30)
Corrected Code
// corrected: match expected parameter count and types
fn add(a: int, b: int) -> int:
    return a + b

let sum = add(10, 20)
print(sum)

Troubleshooting & Remediation

  • 1Check the target function definition and count required parameters.
  • 2Verify default parameter values if optional arguments are intended.
  • 3Use the Language Server (LSP) hover feature in your editor to inspect function signatures.

Relevant CLI Commands

$ nextviper check$ nextviper lsp