def unused

bend-lint-rules@0.2.0.0 · performance/unused_result.bend:84

import bend-lint-rules@0.2.0.0/performance/unused_result.bend as UnusedResult
import Base
import bend-lint-api@0.2.0.0/linter/lint.bend as Lint

84# The type of a binder its facts say is never used, if they do.
85def unused(facts: List<&2, Lint.Fact>) -> Maybe<&2, Lint.TypeRef>:
86  match facts:
87    case Nil{}:
88      None{}
89    case Con{Lint.Fact{Lint.OfBinder{}, q, Some{Lint.Erased{}}, t}, rest}:
90      Some{t}
91    case Con{f, rest}:
92      unused(rest)

Uses (6)

Used by (1)