Repository navigation
Preserve expected types for generic constructor arguments - #1621
Closed
sebastian-griego wants to merge 1 commit into
Closed
sebastian-griego wants to merge 1 commit into
sebastian-griego wants to merge 1 commit into
Conversation
Contributor
Author
ScottMoore0
added a commit
to ScottMoore0/bend
that referenced
this pull request
Oct 16, 2026
…function type (bendlang#1619) Two more tests for a bare constructor in a type losing its goal: a lambda in a generic Box at @-x: Type -> Type (the kernel reported "a λ of its binder's liveness"), and a field whose type depends on an earlier field (export reported "an application past its head's known type" and --verdict rejected the file). Both pass with the fix in this PR. Written by Sebastian Griego in bendlang#1621. Co-authored-by: Sebastian Griego <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Generic constructor arguments can pass Bend's source checker but fail
--verdict. During BendTT export, arg_term does not pass their expected type
to ctr_term. Generic fields then use placeholder datatype parameters. This
can assign the wrong quantity to a lambda or leave a call through a bound
function without a known type.
Pass the existing expected type to unannotated constructor arguments through
the annotation path already used for lambdas and matches. ctr_term can then
use the datatype parameters to instantiate each field type. Existing explicit
annotations remain in use.
Add two proof tests:
Box<@-x: Type -> Type>. The expected field type requires an erased lambda
binder. Before this change, export gives it a live binder.
constructor field. Its result type depends on an earlier field. Before
this change, export loses the type needed for a call through its argument.
Both tests pass source checking before and after the change. Both fail
--verdict before the change and pass after it with the unchanged BendTT
kernel. The local safety-gate run covers all 1,652 existing upstream files
and retains every baseline classification. This was a local gate run, not
a full CI run. With CI's ttok 0.3, safe.ts uses 23,986 of its 24,000 tokens.
The local repository gate reports one existing failure: bend2/comp.ts uses
64,092 tokens against its 64,000-token limit. The file is unchanged from
main (234cb9b), where it has the same count. All other repository rules
pass.