T138error

Invalid index

A value is indexed when it cannot be, or with an index of the wrong type.

Only slices, arrays, maps and strings can be indexed, each with its own index type. Several values in brackets are only valid as type arguments on a generic call.

Index a collection with the right index type.

$ piko explain T138

Build output ends each diagnostic with a link to this page, and editors using the Piko language server link the code under the squiggle. Look for CodeInvalidIndexing in Piko's source to see where it is reported.