lloyAlloy on GitHub
optional_access
Docs

optional_access

Updated

A value that may be nil is indexed without a guard.

A parameter typed T?, or the result of a function that returns T?, is indexed with . or called with : while nothing in the function checks it for nil. Guard it with if x then, x and, assert(x), or use ?. and ?:, which stop the chain at nil.

Set its level in the [lint] table of alloy.toml, or for one file with --@alloy-lint.