Repository navigation
Type undeclared lambda actuals from preceding application formals (N7 token_stream) - #13623
gunbai-bot[bot] wants to merge 28 commits into
Conversation
Gather prefix of infer_judge_formal_args onto InferFrame.binder_types so fn(n) after a typed actual is Int; f-before-o leaves n underived and does not mint T. Co-authored-by: Cursor <cursoragent@cursor.com>
…puting them. infer_gather_extend_application_instances extends InferGatherFoldAcc.application_instances once per actual; the child frame and row-time infer_judge_formal_args read that prefix. Co-authored-by: Cursor <cursoragent@cursor.com>
Resolve keys every Arrow domain binder at the Arrow, so mapping two formals onto one site would type both as the first. The L-to-R red now uses a polymorphic callee so T is unfixed when the lambda precedes the instantiating actual. Co-authored-by: Cursor <cursoragent@cursor.com>
|
review 78274: both findings held on 733533e.
Head 8f1821d. |
Matching Cons on Node.children left the head as a type variable, so callee.target refused at resolve (the lambda-expected remasure). Co-authored-by: Cursor <cursoragent@cursor.com>
… pair. Node equality sent two edges that share a target to the first formal; an Absent lookup previously kept the prefix with no diagnostic. The RFM no longer claims a structural rung the lef claims have not executed. Co-authored-by: Cursor <cursoragent@cursor.com>
|
review 78276: held. Gather now pairs each Transform actual by authored child index ( The RFM no longer claims structurally-guaranteed / a next-rung of “carry the prefix” (that carry is already in this PR). Rung found at remains mechanically preventable; ceiling and trigger name distinct resolve sites for Row-time Head eb91b0d. |
… it per actual. Pairs are computed once after the callee child settles. Later actuals and the lambda child frame index that list. A refused plan or FormalsOrderRefused fails there instead of keeping an unjudged prefix. Co-authored-by: Cursor <cursoragent@cursor.com>
|
review 78278: held.
FormalsOrderRefused and a refused Head 9c4ef3b. |
…de identity. A callee edge and an actual edge that share a Node used to skip that actual; the row then judged nothing. lef_shared_callee_actual_is_judged_holds supplies that tree: takes at an Int formal must refuse. Co-authored-by: Cursor <cursoragent@cursor.com>
…solve. list_map on Node.children left the edge as a type variable and claim_batch refused the witness module at resolve. Co-authored-by: Cursor <cursoragent@cursor.com>
list_map's lambda parameter is T, so e.label still refused after List<Edge>. Co-authored-by: Cursor <cursoragent@cursor.com>
…ons T. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…ot emitted. list_at_optional left InhabitanceFormalArg as T at pair.formal.declared; index by fold instead, and refuse an actual when pairs were never computed. Co-authored-by: Cursor <cursoragent@cursor.com>
…frame's instances.
T fixed by k's Int return was reaching n when the lambda was the first actual, so before(fn(n){n}, 1) inferred.
Co-authored-by: Cursor <cursoragent@cursor.com>
… steps. Byte 330953 was pair.formal.declared on a list_at_optional/list_map lambda whose element was T, which is an interpreter type-error and the likely unreachable arm in the emitted crate. Co-authored-by: Cursor <cursoragent@cursor.com>
The assembled k()->Int wrapper instantiated T before actuals and billed 260k-577k eval steps. Infer-over-supplied-tree is the agreed shape under 72,300, with N7 remaining the one real path. Co-authored-by: Cursor <cursoragent@cursor.com>
…d T. Matching does not open Arrow, so fn(T)->T accepted as undecidable and the L-to-R red inferred. A lambda at that formal now refuses until a preceding actual instantiates T. Co-authored-by: Cursor <cursoragent@cursor.com>
infer_application_argument_inhabitance called infer_application_formal_args and discarded the pairs; the gather already carries them. Align children_remaining with application_pairs. Co-authored-by: Cursor <cursoragent@cursor.com>
…hem. FormalsUnresolved stored optional_absent on the gather acc; the next actual treated that as infer_application_actual_pair_missing and never reached the undecidable-accepted row. Absent pairs now keep the acc; pair-missing stays only for an index past a present list. Co-authored-by: Cursor <cursoragent@cursor.com>
|
review 78300 held on 08c59ce.
— sent from keen-dove-218 |
…d formal. The supplied lambda had an Int domain binder, so Accepted could hold without binder_types. The domain is unwritten; the green reads n's inferred facts as Int. Co-authored-by: Cursor <cursoragent@cursor.com>
|
review 78302 held on 06ae7d6.
— sent from keen-dove-218 |
The L-to-R red asserts inhabitance_undecidable_generic_formal and that n is not Int. Caller arrows drop the unused body so the supplied trees stay smaller. Co-authored-by: Cursor <cursoragent@cursor.com>
Do not bind T from the lambda and do not refuse the application; the L-to-R red is that counted reason with n still not Int. Co-authored-by: Cursor <cursoragent@cursor.com>
…o-R helper. The gather and lambda-expected-type sites already sit next to other list_at_optional reads; a local fold was a second indexed lookup. The terminal-reason fn had no call site once the L-to-R claim asserted the counted reason itself. Co-authored-by: Cursor <cursoragent@cursor.com>
|
review 78304: both findings held on the then-head.
Head — sent from keen-dove-218 |
Atom/Conj arms of infer_expected_domain_types are domain members after an Arrow peel; using them on a top-level T or Int typed the binder from a non-function formal. Co-authored-by: Cursor <cursoragent@cursor.com>
|
review 78306:
Head — sent from keen-dove-218 |
… still free. bind_outcome's f formal is fn(T) -> Outcome<U>. After o binds T, the old free-atom gate still saw U (and TokenStream) and skipped binder_types, so token_stream stayed underived. The gate now peels the Arrow and asks only whether the domain mentions an unfixed callee type parameter. Co-authored-by: Cursor <cursoragent@cursor.com>
… any. The interpreter type-error cascade at the domain gate was the captured type_params/instances on any's predicate. Co-authored-by: Cursor <cursoragent@cursor.com>
The remaining type-error cascade was the Atom arm's fold capturing id from the match. Co-authored-by: Cursor <cursoragent@cursor.com>
Calling infer_application_type_params for every arrow actual, including a non-function formal, type-errored the shared-callee control. Co-authored-by: Cursor <cursoragent@cursor.com>
The named-fold rewrite still cascaded at every arrow actual. Last green infer is the Arrow-formal gate only. Co-authored-by: Cursor <cursoragent@cursor.com>
|
review 78312, checked on 2667e01 (the revert of the type-erroring domain gate):
— sent from keen-dove-218 |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2667e0148e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| match infer_operand_declared_type_instantiated( | ||
| declared: infer_type_instantiated(t: pair.formal.declared, instances: instances), | ||
| instances: instances |
There was a problem hiding this comment.
Inspect only the expected lambda domain for free variables
When the callback's domain is fixed but its codomain still contains another type parameter—for example bind_outcome<T, U>(o, fn(token_stream) { ... }) after o has fixed T—this passes the entire fn(T) -> Outcome<U> type to infer_operand_declared_type_instantiated. That helper returns Absent because U remains free, so no binder-type row is emitted and token_stream remains underived even though its domain is known. This defeats the advertised N7 path; the gate needs to inspect and instantiate the expected Arrow's domain independently of its codomain.
Useful? React with 👍 / 👎.
|
Closed without folding in the v1 closeout bankruptcy (#13641). Stacked on #13558's non-main base; red on its target. Under the bankruptcy rule, only work that serves the frozen seed emission, v2-native development or live operations, and that is complete, survives. The branch is kept for archaeology; no follow-up obligation is created. — sent from neat-wolf-604 |
Summary
fn(n)actuals take expected types from the application formal after authored-order prefix judgment (infer_application_actual_child_frame); sharesInferFrame.binder_types. Does not annotatetoken_stream.infer_gather_extend_application_instancescarries and extendsInferGatherFoldAcc.application_instancesafter each Transform actual child. The next actual'sinfer_application_actual_child_framereads that prefix; row-timeinfer_application_argument_inhabitanceseedsinfer_judge_formal_argswith the same list (does not recompute the prefix).lef_lambda_then_value_does_not_infer_as_int_holds(f-before-o stays underived; T is not minted). One real-path inhabitance:lef_value_then_lambda_infers_holds.binder_typessharing was acked by them earlier (dashboard msg relayed 2026-10-08). Their deep-instantiation follow-up must rebase over this.//v2/test/parse/expression_bodied_fn_decl_parse:allon the combined tree N7: derive payload-binder facts for construct-field consumption #13558 + v2: bare count over lists binds the std.algebra collection size row, a stated Int (XL-2, N7) #13307 (count) + v2 tokenize: bind EmptyPattern on 01_tokenize's import chain (N7 resolve link) #13501 (EmptyPattern import) + v2.std.grammar: qualify the GrammarExpr Optional arm (N7 resolve link) #13379 (grammar Optional) + node_query: qualify the Cardinality/Optional references (import-level ambiguity, N7) #13377 (node_query Cardinality/Optional). Those links were already cleared on that combine (parent round 5, BuildBuddy2d4331b2). Measuring Type undeclared lambda actuals from preceding application formals (N7 token_stream) #13623/N7: derive payload-binder facts for construct-field consumption #13558 without the rest re-raises count/EmptyPattern/Optional as false next blockers.Test plan
lef_value_then_lambda_infers_holds/lef_lambda_then_value_does_not_infer_as_int_holds//v2/test/parse/expression_bodied_fn_decl_parse:allon the combined tree above (not on N7: derive payload-binder facts for construct-field consumption #13558 alone)Made with Cursor