Navigation

Field::inhabitation-failed

Key: Field::inhabitation-failed

Category: inhabitation · Severity: error

Source: src/diag/hints.nix:898

the field's value does not inhabit the declared field type

Example

Hint::Field::inhabitation-failed means the Field position contains a value that does not inhabit the generated type. The example shows the failing form first, then one way to give the checker the missing structure.

# Bad: the field value has the wrong shape.
User.validate { name = 42; }

# Better: use a value inhabiting the field type.
User.validate { name = "alice"; }

← All diagnostic hints