S0015: len expects one argument
Generated from rellum-diagnostics/src/db.rs.
Explanation
The len built-in has exactly one operand: the array whose element count should be read. Extra arguments leave the compiler with no defined interpretation, and missing arguments leave it without an array value.
Common causes
- calling len with no arguments
- calling len with multiple values instead of one array
- passing values separately when an array literal was intended
Canonical fixes
- pass one array value to len
Before:
count = len(a, b)
After:
count = len([a, b])
- remove extra arguments
Before:
count = len(items, fallback)
After:
count = len(items)
Code example
count = len(a, b)