Why this fires¶
A .field access named a field that doesn't exist on the receiver's struct type. Concrete causes:
- A typo (
.nmaeinstead of.name). - The field was renamed or removed.
- The receiver's type was inferred as a different struct than expected.
struct User { name: str, age: int }
fn greet(u: User) {
print(u.nmae)
// ^^^^ error[TE102]: struct 'User' has no field 'nmae'. Did you mean 'name'?
}Fix it¶
1. Fix the spelling¶
Trust the "did you mean?" suggestion when it appears.
fn greet(u: User) {
print(u.name) // fixed
}2. Check the receiver's actual type¶
If the field genuinely doesn't exist, confirm the receiver is the struct you think it is — an explicit annotation or hovering the value in the editor will confirm.
See also¶
TE104— no method with that name (methods, not fields).TE123— the same "unknown field" check inside a destructuring pattern.- /docs/data-structures#structs — struct fields.