UnneededPlus.matched.visit: def of bend-lint-rules@0.2.0.0 Import: import bend-lint-rules@0.2.0.0/language/unneeded_plus.bend as UnneededPlus Lines 43-66 of bend-lint-rules@0.2.0.0/language/unneeded_plus.bend: https://jend.leeeet.dev/read.txt?path=bend-lint-rules@0.2.0.0/language/unneeded_plus.bend&start_line=43&end_line=66 import Base import bend-lint-api@0.2.0.0/linter/lint.bend as Lint import bend-lint-api@0.2.0.0/shared/lists.bend as Lists # The binder a variable below `path` uses, if it is taken apart there: it is a match's scrutinee, or the value of a let # with a constructor pattern (`Vert{x, y} = v`). def matched.visit(+u: Unit, +path: List<&2, Lint.Above>, +node: Lint.Node) -> List<&2, U32>: match path node: case Con{ Lint.Above{Lint.Node{Lint.Match{}, n, s, k, f}, at}, up } Lint.Node{Lint.Variable{b}, vn, vs, vk, vf}: [b] case Con{ Lint.Above{Lint.Node{Lint.Destructure{q}, n, s, +kids, f}, +at}, up } Lint.Node{Lint.Variable{b}, vn, vs, vk, vf}: Bool.pick( List<&2, U32>, Bool.not( U32.is_eq((at + 1: U32), U32.from_nat(Lists.length(&2, Lint.Node, kids))) ) && is_constructed(kids), [b], [] ) case _ _: [] Uses (14): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.not https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.pick https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.from_nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_eq https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Unit https://jend.leeeet.dev/definition.txt?path=bend-lint-api@0.2.0.0/linter/lint.bend&name=Above https://jend.leeeet.dev/definition.txt?path=bend-lint-api@0.2.0.0/linter/lint.bend&name=Node https://jend.leeeet.dev/definition.txt?path=bend-lint-api@0.2.0.0/linter/lint.bend&name=Syntax https://jend.leeeet.dev/definition.txt?path=bend-lint-api@0.2.0.0/shared/lists.bend&name=length https://jend.leeeet.dev/definition.txt?path=bend-lint-rules@0.2.0.0/language/unneeded_plus.bend&name=is_constructed