M Mozhi v3.7.0 code

Error reference › Runtime diagnostics

RUNTIME007

value is not callable

error
verifiedverified on v3.7.0 categoryruntime terminalstable code

What it means

Only functions (user `fn`), built-ins, and native-module functions are callable. Calling anything else is an error — often the result of shadowing a function name with a variable, or calling a module constant like a function.

Trigger condition

A value that is not a function is called: `x()` where `x` holds a number, string, array, etc.

Minimal failing example

let x = 5
x()

Verified fix

let x = 5
echo(string(x))

Call functions, not values. For module constants, access them without parentheses: `math.pi`, not `math.pi()`.

What the interpreter prints

error[RUNTIME007]: value is not callable
  --> app.mz:1:16
 1 | let x = 5
   |                 ^
   |
reason: (the exact problem, with positions)
help:   (a suggested fix appears here)
docs:   https://crossberry-in.github.io/mozhi-doc/errors/RUNTIME007
Run mozhi --json run app.mz to get the same information as machine-readable JSON (schema mozhi.diagnostics.v1), or --verbose to also show grouped related diagnostics. See the CLI reference.

Suggested fix

Check what the name holds at the call site; rename one of the conflicting bindings.

Related syntax

Function calls, modules

Related diagnostics

NAME002RUNTIME004

Reference links

Limitations

Native objects report a separate message ('Native object is not callable') under the same code.