You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A + binder in a nested tuple let fails with 'an annotated term (cannot infer)' when the goal mentions the pair #1077
All terms check. The file checks when +c is written as c.
What happened
Error:
- expected : an annotated term (cannot infer)
- observed : _ => List<&2, U32>
Context:
- a : U32
- b : Bool
Location: lemma
127 | def Pair(-A: Type, -B: Type) -> Type:
128>| Sigma<&1, &1, A, _ => B>
It needs all three parts:
a + on a binder in a tuple let,
a let on a pair that came out of an earlier tuple let (rest), and
a goal that mentions the outer pair r, so the checker refines it.
A flat (a, +c) = r checks, and so does (a, b, c) = r without +. This looks like the tuple-let path of #810: that fix moved + onto the binder for braced patterns, and the observed term is the Pair family lambda, which does not infer.
Workaround
Bind the components without + and pass them to a helper that takes + parameters.
bend t.bend fails with the same an annotated term (cannot infer) / observed : _ => U32 at Pair. (+a, +i, +c) = r fails too, and so does (a, +i, c0) = r followed by +c = c0. (a, +i, c) = r with c used once checks and prints 7.
Still present on Bend 2.0.38 (macOS 26, arm64). Here, + binds the last field of a triple whose first two fields are affine (Type) values:
type BrisType:
Br{r: Bits.Reader, bad: Bool}
deff(+x: U32, b: Br) ->Br:
bdefg(r: Bits.Huff&Br&U32) ->Br:
(h, b, +s) =rf(s, b)
The check fails with an annotated term (cannot infer) / observed : _ => U32 at Pair. A two-step bind (h, bs) = r then (b, +s) = bs fails the same way. (b, +s) = bs on a parameter bs: Br & U32 checks. Workaround: bind s without + and pass it to a helper that takes +s.
Activity
paymog commentedon Sep 27, 2026
Another reproduction on Bend 2.0.31 (macOS 26, arm64). It is smaller: a flat triple, no goal that mentions the pair.
bend t.bendfails with the samean annotated term (cannot infer)/observed : _ => U32atPair.(+a, +i, +c) = rfails too, and so does(a, +i, c0) = rfollowed by+c = c0.(a, +i, c) = rwithcused once checks and prints7.paymog commentedon Oct 28, 2026
Still present on Bend 2.0.38 (macOS 26, arm64). Here,
+binds the last field of a triple whose first two fields are affine (Type) values:The check fails with
an annotated term (cannot infer)/observed : _ => U32atPair. A two-step bind(h, bs) = rthen(b, +s) = bsfails the same way.(b, +s) = bson a parameterbs: Br & U32checks. Workaround: bindswithout+and pass it to a helper that takes+s.