ErrorsStandard library · rule
type.reserved_variant_name
Variant is called all, which lists an enum's variants.
Area 19, Standard library; not declinable; the next step is usually the agent's.
.all lists every variant of an enum whose variants carry no data, so
no enum declares a variant called all. A closed list
whose code is all writes it with a trailing _, as Albania's lek is
Currency.all_.
type Newsletter = Enum { subscribed all}
error all can't be a variant of Newsletter
--> main.jadpo:3:5
|3 | all | ^^^ reserved
- reason
Newsletter.alllists every variant ofNewsletter, so no variant takes the nameall.- next
- Rename the variant (agent)
- rule
- type.
reserved_ variant_ name - help
- https://jadpo.
dev/docs/errors/type. reserved_ variant_ name
true, false and none are values, so no variant takes those names either:
beside a Kind?, Kind.none would read as the none it isn't. Any other
reserved word may name a variant.
type Compression = Enum { gzip none}
error none can't be a variant of Compression
--> main.jadpo:3:5
|3 | none | ^^^^ reserved
- reason
noneis a value in its own right, andCompression.nonebeside it would read as that value, which it isn't.- next
- Rename the variant (agent)
- rule
- type.
reserved_ variant_ name - help
- https://jadpo.
dev/docs/errors/type. reserved_ variant_ name
Markdown for agents: /docs/errors/type.reserved_variant_name.md.Built from Jadpo main at aee2e8f.