E4115#
不能自动填充此类型的参数。
MoonBit 支持自动填充 SourceLoc
和 ArgsLoc
参数的函数。将其他类型参数的默认值留空将导致出现此错误。
错误示例#
fn f(parameter~ : Int = _) -> Unit {
// ^~~~~~~~~ Error: Cannot auto-fill parameter of type Int
}
建议#
为参数使用默认值:
fn f(parameter~ : Int = 0) -> Unit {
}