E0005: duplicate name in a declaration

View source

Some names must be unique inside the declaration that holds them.

Some names must be unique inside the declaration that holds them. The parser reports this error for an enum name that is declared twice in one file, for an enum variant that is repeated inside one enum, and for a generic parameter that is repeated in one parameter list. The message names the kind of name and the name itself. Duplicate verbs, structs and other items are reported later, by the semantic checks, with their own codes.

Example

actus
enum Color {
    Red,
    Green,
    Red,
}

verb main() {
}
actus
verb pick[T, T](ins first: T) {
}

verb main() {
}

Fix

Give every name a different spelling, or remove the repeated one.

actus
enum Color {
    Red,
    Green,
    Blue,
}

verb main() {
}
actus
verb pick[T, U](ins first: T) {
}

verb main() {
}

Run actus explain E0005 in your terminal to read this entry offline. Browse Lexer & parser or all error codes.