E1030: field declared twice in a struct

View source

The fields of a struct are identified by name, so each name can be declared only once.

The fields of a struct are identified by name, so each name can be declared only once. The error points at the second field.

Example

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

verb main() {
}

Fix

Give each field its own name.

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

verb main() {
}

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