The struct has no field with this name. The note lists its fields and may suggest the one you meant.
Wrong#
struct User { name: str }
fn hello(u: User): str = "hi {u.nmae}"Fixed#
struct User { name: str }
fn hello(u: User): str = "hi {u.name}"Common causes#
- A typo in the field name.
- A method called without parentheses (
xs.leninstead ofxs.len()). - Reading a field from the wrong struct type.