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
Reserve opaque template names across validation order - #1006
The checker accepts a closed inhabitant of Empty when a later declaration reuses the generated name of an opaque ~ template binder. Validation deliberately hides later declarations, so the existing freshness check sees only the partial TLD table; after validation, the checked body's Ref can resolve to the later declaration.
Reserve every parsed TLD and constructor name before ordered validation, and check generated opaque names against that complete set. Ordered replay still hides future declarations for ordinary forward-reference checking. The regression suite includes the reported constructor/TLD capture and a constructor declared after a valid template fill.
Current unpatched upstream accepts the reported reproducer with All terms check.; this branch rejects it with a fresh ~ binder name.
Local check/interpret harness: 1,416 of 1,429 tests matched exactly. The other 13 are TCP/UDP tests blocked by this sandbox's socket permissions (Operation not permitted / no free port).
bend2/base.bend --check-only passes with only its expected two unsafe/foreign notices.
TypeScript produces the same four pre-existing diagnostics on upstream and this branch; this change adds none.
gates/repo.ts could not run locally because its external ttok executable is unavailable.
Thank you for this, and for the clear write-up and the regression cases. I'm closing it in favour of #1042, which fixes #994 at the source instead.
#1042 limits declared names to words joined by dots and import paths to plain segments, so a ~ name exists only when the checker or compiler mints it. A later def, constructor or file can no longer spell k~B, whatever order validation runs in. I ran both of your tests on #1042: each is now refused while loading, at the import of law.k~B.bend, before any checking happens. With that, reserving names ahead of validation is no longer needed.
If you think this is a mistake and your change should still be merged, feel free to reopen and leave a comment.
--
Note: this comment was written by an AI after it tested the PR for me and I reviewed the findings. If anything here is wrong, reply and I will review it myself.
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
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.
The checker accepts a closed inhabitant of
Emptywhen a later declaration reuses the generated name of an opaque~template binder. Validation deliberately hides later declarations, so the existing freshness check sees only the partial TLD table; after validation, the checked body'sRefcan resolve to the later declaration.Reserve every parsed TLD and constructor name before ordered validation, and check generated opaque names against that complete set. Ordered replay still hides future declarations for ordinary forward-reference checking. The regression suite includes the reported constructor/TLD capture and a constructor declared after a valid template fill.
Closes #994.
Validation:
All terms check.; this branch rejects it witha fresh ~ binder name.Operation not permitted/ no free port).bend2/base.bend --check-onlypasses with only its expected two unsafe/foreign notices.gates/repo.tscould not run locally because its externalttokexecutable is unavailable.