E1810: enum with no variants

View source

An enum must declare at least one variant.

An enum must declare at least one variant. An empty enum has no value that can be built and no pattern that can match it, so it can never be used (ADR-0041). An empty struct is different: it is a valid zero-sized type. The message names the enum, as in enum `Empty` must declare at least one variant. The error points at the enum keyword.

Example

actus
enum Empty {
}

verb main() {
}

Fix

Declare the variants of the enum. If the type only needs to exist as a marker, use an empty struct instead.

actus
enum Signal {
    Rising,
    Falling,
}

verb main() {
}

Run actus explain E1810 in your terminal to read this entry offline. Browse Strict & toolchain or all error codes.