E4003

E4003#

This is a reserved type name. Cannot declare it as a type variable, type, or trait.

Primitive type names such as Int32 and String cannot be redeclared. Not every type from the prelude is reserved: Array and Result, for example, can be used for user-defined types.

Erroneous Example#

struct Error {}

Error is the reserved name for the built-in error type, so it cannot be used for a custom type. This will give the following error on line 1:

"Error" is a reserved type name. Cannot declare it as type

Suggestion#

Consider using another name for your type, such as MyError or Error_.

///|
priv struct MyError {}

///|
pub fn make() -> Unit {
  ignore(MyError::{  })
}