E3800

E3800#

Expecting a newline or ; here, but encountered another delimiter.

Constructors in enum definition, fields in struct definition, and constructors in error type type! definition, should be separated by a newline or a ;. It is so common for AI to generate code with a wrong delimiter , that we specifically catch this error to help you and AI fix it.

Erroneous example#

enum V {
  A, // Error: Expecting a newline or `;` here, but encountered another delimiter `,`.
}

struct S {
  a : Int, // Error: Expecting a newline or `;` here, but encountered another delimiter `,`.
}

type! E {
  A, // Error: Expecting a newline or `;` here, but encountered another delimiter `,`.
}

Suggestion#

Replace , with a newline or ; as appropriate. We suggest using a newline since it conforms to the MoonBit style suggested by the MoonBit formatter.

enum V {
  A
}

struct S {
  a : Int
}

type! E {
  A
}