E3800

E3800#

这里期望一个换行符或 ;,但遇到了另一个分隔符。

enum 定义中的构造器、struct 定义中的字段和错误类型 type! 定义中的构造器,应该用换行符或 ; 分隔。AI 生成的代码中常常会出现错误的分隔符 ,,因此我们特意捕获这个错误来帮助你和 AI 修复它。

错误示例#

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 `,`.
}

建议#

, 替换为适当的换行符或 ;。我们建议使用换行符,因为它符合 MoonBit 格式化程序建议的 MoonBit 风格。

enum V {
  A
}

struct S {
  a : Int
}

type! E {
  A
}