S0052: unknown field in pattern
Generated from rellum-diagnostics/src/db.rs.
Explanation
Record and enum variant patterns may bind only fields declared on the matched type or variant. The compiler checks field names statically so destructuring cannot read a payload slot that does not exist.
Common causes
- misspelling a field name in a pattern
- using a field from a different record type
- matching the wrong enum variant payload shape
Canonical fixes
- use a field declared by the matched type
Before:
Point { width }
After:
Point { x }
- update the type definition if the field should exist
Code example
Point { width }