feat(checker,lint): bare contextual cases and the bare-case lint rule #765
No reviewers
Labels
No labels
loop
queue/failed
queue/queued
ready
status/parked
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
torbscript/language!765
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/743-bare-case"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #743
CLOSED-TRAITS 1a-1, two commits.
feat(checker): a bare contextual case resolves by rule 6.2 beside.Caseat every 6.1 position (construction, pattern, argument, return, comparison): the file's own names, then the cases of the expected type (with theOption/Resultpayload fallback), then the prelude. The 6.2 and 6.3 collisions and the "needs a type here" case carry the 6.8 messages, pinned by tests..Case,.memberand the leading-dot arm of amatchread as before. Completion offers the cases of the expected type and highlighting marks a bare case. Conformance programs pin the positions and the precedence on the native and the bytecode tier.feat(lint): thebare-caserule reports every.Case;--fixremoves the dot where the bare name is the same case and writesOwner.Casewhere it would collide, and a second run changes nothing. Theself-namefix writes the bare form in a pattern.docs/tooling/torb-lint.mdand the skill copies say so.Not in this PR: no source of compiler/, std/, examples/ or tests/ is migrated beyond the new tests, nothing under seed/ changes, and the rewrite of the "cases are never bare" prose is a later docs slice.
Known limits: the highlighter is syntactic (declared and imported cases), and completion of a bare case starts once the first letter of the name is typed. A file with a checker problem gets
bare-casefindings without a fix.Verification: the gates, the fixpoint and the conformance expectations were not run locally (there is no compiler in the worker environment); the expected outputs of the new conformance programs are hand-written, so CI is the first run.
16f306fbcdf647c4429df647c4429d318822e0d6.Case, and thebare-caselint rule (CLOSED-TRAITS 1a-1) #743.Case, and thebare-caselint rule (CLOSED-TRAITS 1a-1) #743.Case, and thebare-caselint rule (CLOSED-TRAITS 1a-1) #743318822e0d681d2b9f7d081d2b9f7d0a7b780b86a.Case, and thebare-caselint rule (CLOSED-TRAITS 1a-1) #743Checklist for
a7b780b:compiler/tests/bare-cases.test.trb, adapted checker/lint/highlight/language-server tests, and two conformance programs (positions, precedence). CI is green for this head, including bootstrap, tier A, the JS and PHP conformance runs, and the pdisc check, so the hand-written expected outputs held.contextualTarget(the file's own names, then the cases of the expected type, then the prelude) matches the PR description. The collision, "needs a type here" and misspelled-case messages are pinned by tests. A leading-dot arm and.Caseresolve as before.Non-blocking:
tests/conformance/bare-case-*.allocationssay "unbudgeted: ... not measured". That is a valid form fortools/conformance.sh, but the reason is that nobody ran it, not that the count varies. Runsh tools/conformance.sh --filter bare-case --update-budgetsin a follow-up and commit real numbers..Case, and thebare-caselint rule (CLOSED-TRAITS 1a-1) #743