language · keyword ·
enum
Declare named cases
Use an enum when the valid states are finite and you want the compiler and reader to see every named possibility.
enumStatus: experimental
Warning nonexhaustive
Use an enum when the valid states are finite and you want the compiler and reader to see every named possibility.
cpu · complete-program · type checked
enum color
{
red
blue
}
color value = color.red
match value
{
color.red { Console.Log("red") }
}
project.mech
package = "tests.compiler.conformance.warningNonexhaustive"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"
backend = "cpu-oracle"
Notes and source
Plain enums are stable enough for ordinary use; richer payload matching remains experimental across targets.
The removed choice spelling is not accepted. Use enum.
yeho/parser_declarations.cpp parseEnumDecl; parser_statements.cpp parseMatchStatement; conformance payload-enum-patterns