BSK-E0011 error

Return type mismatch

Emitted as an Error when the literal value returned by a function is clearly incompatible with the declared return type annotation (e.g. returning an int literal from a -> str function).

The explicit-Any warning used to share this code; it now lives under its own warning code (BSK-W0014) so the opinionated style nudge can be silenced independently of this genuine type-safety error.

# BAD (return type mismatch)
def count() -> str:
    return 42   # E: int literal is not assignable to str

# GOOD
def count() -> int:
    return 42

How to handle it

Every rule is on by default — strict is the default, not a cage. You can dial BSK-E0011 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-E0011