S0041: unknown record or enum type in construction
Generated from rellum-diagnostics/src/db.rs.
Explanation
Record and enum construction must name a known type of the correct kind. If the name does not resolve, or resolves to the other kind, the compiler cannot determine the payload layout to construct.
Common causes
- misspelling a record or enum type name
- constructing a record with an enum name
- constructing an enum variant with a record name
- forgetting to import the type
Canonical fixes
- use the declared record or enum type name
Before:
value = Ponit { x: 0, y: 0 }
After:
value = Point { x: 0, y: 0 }
- declare or import the type before construction
Code example
value = Ponit { x: 0, y: 0 }