def scrutinee
import bend-lint-rules@0.2.0.0/language/reused_binder.bend as ReusedBinderimport Base
import bend-lint-api@0.2.0.0/linter/lint.bend as Lint
50# The binders a match takes apart: the variables right under it, its scrutinees. In a case, they stand for the matched
51# constructor.
52def scrutinee(+u: Unit, +path: List<&2, Lint.Above>, +node: Lint.Node) -> List<&2, U32>:
53 match path node:
54 case Con{
55 Lint.Above{Lint.Node{Lint.Match{}, mn, ms, mk, mf}, at},
56 up
57 } Lint.Node{Lint.Variable{b}, n, s, k, f}:
58 [b]
59 case _ _:
60 []