def dup_defect

bend-schema-lib@0.4.1.0 · core.bend:1137

import bend-schema-lib@0.4.1.0/core.bend as Core
import Base

1137# The claim about a second key: every key passed is absent, and the key the
1138# path names is there.
1139def dup_defect(s: Schema, +r: Raw, p: List<&2, Step>) -> Maybe<&2, Why>:
1140  match s p:
1141    case SVariant{+n2, vs, rr} AtField{0n, m} <> Nil{}:
1142      guard(Bool.and(String.eq(m, n2), Bool.not(is_missing(lookup(n2, r)))), Some{TwoVariants{}})
1143    case SVariant{+n2, vs, rr} AtField{1n+j, m} <> q:
1144      guard(is_missing(lookup(n2, r)), dup_defect(rr, r, AtField{j, m} <> q))
1145    case _ _:
1146      None{}

Uses (13)

Used by (1)