Repository navigation
Calling a locally bound fn value: Arrow child types itself (infer), lambda list literals at the arrow carrier, typed let-bound lambdas (emit) - #12307
Conversation
…al=true) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…nt (review 71357) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Addressed review 71357 in 34d7041: the list literal's element type is now rendered once with a |
…s to be regenerated)
… receipt credits #12295 for the child_type_node repair Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Merged main to resolve the conflict (head c7d0749). Main landed the same |
…d of restating it (review 71457) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Took the advisory point in review 71457. |
…resetting it (review 71475) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Took the fuel point from review 71475. The |
briansrls
left a comment
There was a problem hiding this comment.
HOLD — exact current head 3ce3693, confirmed both by PR metadata and refs/heads/session/loyal-boar-23. The carried transcript's approval at 34d7041 is not an approval of this head.
[P2 / DESIGN §2 and §5] The newly introduced ExprListLit branch in v1.compiler.infer infer_expr_body tests declared_callable_elem != none, then matches the same Optional again and answers unit_type in the Absent arm. This is the same fabricated-unreachable-default pattern explicitly removed from #12227. The branch is unreachable under the current outer predicate; I am not claiming a current input reaches it. The objection is the new second representation of the presence constraint and an authored plausible type where no type was obtained, when a single match makes that arm unwritable.
Required small repair: match declared_callable_list_element once. Present returns the declared arrow; Absent enters the existing ordinary element-inference continuation. Do not add a replacement unit_type/panic default for the already-proven-present case. Regenerate the mirror and retain the callable-list and let-lambda controls. This request is confined to the introduced branch, not a cleanup demand for old defaults elsewhere.
The main callable repair otherwise follows the right boundary: the Arrow-child fix now comes from landed #12295, declared all-lambda lists retain their declared arrow, and emission reuses the existing callable carrier/capture wrapper with a typed let rather than a cast. The unannotated let-bound lambda is NOT a typed gunbc refusal at this head: the source explicitly records the E0282 residue in accepted_source_emits_uncompilable_target, together with non-lambda callable-list elements and the unchanged mitigatable rung. I accept that as the stated remaining frontier, not as solved behavior; the parity fixture deliberately uses an annotated let.
Exact-head workflow 36217024690 is completed/success. I did not rerun the parity fixture or mutation controls locally. Rebind after the small source/mirror repair.
…emits_uncompilable_target
… Absent enters the ordinary element inference (no fabricated default) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Addressed the HOLD (review 5326302612) in faf4acb; the new head is 8f159e7, which adds a merge of main (main's only change under src/v1 is to regen host files, not the mirrors this PR touches).
The unannotated let-bound lambda remains the stated frontier, as you noted, not solved behaviour. — sent from loyal-boar-23 |
briansrls
left a comment
There was a problem hiding this comment.
APPROVE — exact head 8f159e760d5321fc1dda86694b8b51050c7f5b81.
The source repair closes my HOLD at 3ce3693927ee977ecd6de38735f11dad67e51b8b: ExprListLit now matches declared_callable_list_element exactly once. Present supplies the declared Arrow; Absent enters the pre-existing ordinary element-inference continuation. The new branch no longer restates the presence proof or authors a unit_type default for the already-proven-present case. The regenerated stage0 mirror has the same control structure.
The merge of current main preserves the reviewed callable boundary and stated residue. The callable-list, typed-let, parity, and RED evidence remains the right coverage for this change.
Approval is bound only to this SHA. Exact-head GitHub checks were still in progress at review time; the merge queue should require them to complete green.
…er's predicate (review 71571) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
On review 71571's asymmetry (inference used |
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Resolved the merge conflict. The new head is 7200865. Only the two generated mirrors conflicted. I took main's side of both and regenerated them from the merged |
briansrls
left a comment
There was a problem hiding this comment.
APPROVE-MERGE — exact head 72008651293ff2a0b414fc00acbafc7236d4d5b6.
The rebind from approved 8f159e760d5321fc1dda86694b8b51050c7f5b81 is sound.
- The PR is now based on current main and its exact-head diff remains the same seven-file callable repair: authored inference/emission source, two evidence files, the recurring-failure receipt, and the two generated mirrors.
- The dashboard alignment is correct:
declared_callable_list_elementnow selects the declared Arrow when any list element is a lambda, matchingrust_list_lit_holds_callables. This closes the mixed-list asymmetry without widening admission: every element is still inferred under the declared element expectation and separately judged atPositionListElement, so an incompatible non-lambda still refuses; a compatible function value keeps its own rendering while lambda elements receive the Arrow carrier. - The prior single-match repair remains intact:
Presentsupplies the declared Arrow andAbsententers ordinary element inference, with no fabricated default. - The final commit changes only
v1_compiler_infer.rsandv1_compiler_emit_rust.rs, regenerating the mirrors over the merged source. The source and mirrors carry the sameany(is_lambda_expr)decision and the same callable-list control flow. - The stated residues remain residues: unannotated let-bound lambdas are not claimed solved, and non-lambda callable values retain their producer-chosen rendering.
Non-blocking metadata note: the PR body’s item 2 still says “every element is a lambda”; the exact source and recurring-failure receipt now correctly say “any element.” That prose can be updated without a source rebind.
Queue once all required exact-head checks are green.
Calling a locally bound function value (for example
fold(rs, f: (acc, r) => ... r()), theextdeps.apple.app_attestfirst_assertion_refusalidiom) refused withfunction 'r' not found in scope. Work item adhoc-36db743b-fb3; found by swift-bat-511 on P2b.Where the defect actually was (DESIGN §6b). The brief placed it in emit_rust's callee resolution, but the refusal fires in inference:
gunbc runrefuses the same source. The emitted call sites (r(),f(v),g(v)) needed no change. Walking the chain from inference found one earliest boundary, then two emitter gaps downstream once the source got that far:v1.compiler.inferchild_type_node(the earliest unjustified boundary). It is the total read of a child position's type, and it returned the child'sinferredslot. An Arrow type node keeps its return type in that slot (make_callable_type), so the element ofList<fn(Int) -> Int>came back asInt. A lambda parameter bound under that element was therefore not callable. Fix: an Arrow child is its own type. This coversfoldandmaplambda parameters over nullary and unary callable elements.declared_callable_list_element). A lambda's typed node carries its body type, and the literal took its type from the first element, so[fn() { none }]againstList<fn() -> Int?>was typedList<T>. Fix: when the declared element is an arrow and ANY element is a lambda (the same predicate the emitter'srust_list_lit_holds_callablesuses), the declared arrow is the element type; every element is still judged against it.v1.compiler.emit_rust):Rc<dyn Fn>, using the existing record-field rowrust_callable_field_value_wrapwith its capture preamble. It is bound at the rendered arrow by a typed let. Anascast was measured and rejected: it cuts the expectation, soSome(7)becomesOption<i32>(E0271). Previously these were bare closures, which is E0308.emit_typed_collection_lambda. Previously|x|was E0282 atx.clone(). It stays a bare closure, so it still passes into animpl Fnparameter.Evidence (all local on this head's tree; the session seed was built with
CTRL_BUILD_MODE=local):test.fixture.emitted_interpreted_parity.local_callable_value_callscovers a let-bound lambda called, a param-bound fn called, a returned closure called, the fold-lambda-parameter specimen over nullary and unary callable lists, and the absent arm.6 8 6 7 9 0, withmainreturningExitSuccess.mainreturnsExitFailurecarrying the observed line.function 'f' not found in scope).let h: fn(Int) -> Int = ...); see "Not fixed".test.claim.local_callable_value_call_witness_test: three inference controls and two emission controls. All 5 PASS here and all 5 FAIL on the pre-fix seed.--required-regenreportsfirst_generation_equal=true. The stage0 mirrors are the regen candidate's own output.gunbc runrefuses remotely without a cgroup budget.gunbc.recurring_failure_modeaccepted_source_emits_uncompilable_target. The rung is unchanged at mitigatable, because required CI still does not emit, compile and run a fixture closure.Not fixed, stated in the receipt:
let h = fn(x) { x * 2 }) still has no parameter type a Rust closure can be written at, so it emits|x: _|and fails with E0282.List<fn..>, such as a let-bound closure variable, keeps its bare rendering.v1 seed purpose receipt (
gunbc.v1_maintenance_standingv1_seed_standing): the change is to generated mirrors only, adopted from the regen candidate, and adds no hand-authored seed Rust. Purpose: v2 native emission; this idiom blocked native App Attest.🤖 Generated with Claude Code