Rellum Rellum

S0010: indexing requires an array

Generated from rellum-diagnostics/src/db.rs.

Explanation

Index expressions read an element from an array value. Scalars, tuples, records, enums, and non-array Shared[T] handles do not have array element storage, so they cannot be indexed.

Common causes

Canonical fixes

Before:

first = item[0]

After:

items = [item]
first = items[0]

Before:

first = pair[0]

After:

first = pair.0

Code example

first = item[0]