def verdict.on

bolt@1.27.0.0 · src/rules/correctness/arms.bend:79

import bolt@1.27.0.0/src/rules/correctness/arms.bend as Arms
import Base
import bolt@1.27.0.0/src/finding.bend as F

79# a finding when the arm is inside the widest one above
80def verdict.on(+kk: U32, +text: String, aa: Arm, +path: String, +more: List<&2, F.Finding>) -> List<&2, F.Finding>:
81  match aa:
82    case APlus{+j, t, l, c, n}:
83      Bool.pick(List<&2, F.Finding>, U32.is_ge(j, kk),
84        F.Finding{path, l, c, n, "arms",
85          "Unreachable: the case " ++ text ++ " above already matches everything from " ++ U32.show(j)
86            ++ "n up; put narrower arms first."} <> more,
87        more)
88    case ALit{+m, l, c, n}:
89      Bool.pick(List<&2, F.Finding>, U32.is_ge(m, kk),
90        F.Finding{path, l, c, n, "arms",
91          "Unreachable: the case " ++ text ++ " above already matches " ++ U32.show(m) ++ "n; put narrower arms first."}
92          <> more,
93        more)
94    case AOther{}:
95      more

Uses (9)

Used by (1)