defseconds:List(Listα)→Listα|[]=>[]|_::xss=>secondsxss|Redundant alternative: Any expression matching(head✝::x::tail✝)::xsswill match one of the preceding alternatives(_::x::_)::xss=>x::secondsxss
Redundant alternative: Any expression matching(head✝::x::tail✝)::xsswill match one of the preceding alternatives
这里,回退分支用于捕获 p 中所有不匹配 (m, n) 的值。
然而,不存在这样的值,因此回退分支是不必要的,可以将其删除。当使用 if let pat := e 且
e 总会匹配 pat 时,也会产生类似错误。
模式被视为变量而非构造器
example(xs:ListNat):Bool:=matchxswith|Local variable 'nil' resembles constructor 'List.nil' - write '.nil' (with a dot) or 'List.nil' to use the constructor.Note: This linter can be disabled with `set_option linter.constructorNameAsVariable false`nil=>false|Redundant alternative: Any expression matchingx✝will match one of the preceding alternatives_=>true
Redundant alternative: Any expression matchingx✝will match one of the preceding alternatives