BSK-E0018 error

Undefined variable used in a return statement

Flags any name referenced in a return expression — bare (return x), the base of an attribute/subscript chain (return x.y), a call argument, or the **callee of a call** (return x()) — that is not defined in scope. A name is considered defined if it is a parameter, a local assignment (=, for, with), a module-level function, class, variable, or import, an enclosing scope's binding, a cross-module imported symbol, or a builtin.

def compute() -> int:
    return undefined_name     # never defined → E0018
    return undefined_fn()     # undefined callee → E0018

Real basilisk check output

What you see when BSK-E0018 fires on a minimal example:

basilisk check output reporting BSK-E0018 — Undefined variable used in a return statement

How to handle it

Every rule is on by default — strict is the default, not a cage. You can dial BSK-E0018 down per-file or per-path from your editor or pyproject.toml, or fix the code so it type-checks. See the Type Safety rules and the complete diagnostic reference.

Canonical URL: https://www.basilisk-python.dev/errors/BSK-E0018