E1029: struct declared twice

View source

A module can hold only one struct with a given name.

A module can hold only one struct with a given name. Two declarations would give the same type name two layouts. The error points at the second declaration.

Example

actus
struct Point {
    x: Int,
}

struct Point {
    y: Int,
}

verb main() {
}

Fix

Rename one of the structs, or merge their fields into one declaration.

actus
struct Point {
    x: Int,
    y: Int,
}

verb main() {
}

Run actus explain E1029 in your terminal to read this entry offline. Browse Ownership & types or all error codes.