LYR-SEM0012
a member the type does not have
A member access x.name names no field, method or element of the value's type, or reads a member that is a method without calling it (length instead of length()). A tuple position past its last element is reported here too.
Explanation
A member comes from the type's declaration, from its conformances, or from an extend block in scope. A block of methods is in scope where its module is imported, whatever the import names: import std.io; brings writeAll to everything that is a Writer. Built-in members such as an array's length() are methods and are called.
Correct the name, call the method, or import the module of the block that adds the member; the error names that module where the program already holds it. A module nothing in the program imports is not read, so its blocks cannot be named.
Wrong
fn main(): void {
let xs = [1, 2, 3];
let _ = xs.length;
}
Right
fn main(): void {
let xs = [1, 2, 3];
let _ = xs.length();
}