language: closed traits, every case is a type (CLOSED-TRAITS phases 1a, 1b and 2, epic) #713

Open
opened 2026-11-07 22:38:46 +00:00 by orion · 2 comments
Collaborator

Context

docs/design/CLOSED-TRAITS.md is accepted: "phases 1a, 1b and 2 to build; 3 deferred", decided by the owner on 2026-09-28 and 2026-09-29. A type with case members is the closed trait, a case is a type of its own, and a case is written bare where the expected type names it, so the leading dot goes. The record says "Nothing of this record is implemented yet", and no issue tracks it.

Source

  • CLOSED-TRAITS.md section 9 (migration and phases), 9.2 (phase 1a in two commits with the seed between), 9.3 (phases 1b, 2 and 3, and the newtypes of decision 7.3 "before 1.0"), 9.4 (sizes).
  • Phase 1a is breaking syntax (.Case and .member are refused after its commit 2), so it has to land before 1.0.

Steps (epic: no ready on this issue)

  • 1a-1. (#743) Teach both forms: bare contextual cases resolved by the rule of 6.2 beside .Case, the bare-case lint rule with its fix, messages, completion and highlighting (tier A and tier B)
  • 1a-seed. Refresh and publish the seed after 1a-1 is on main (the owner's step)
  • 1a-2. Migrate and refuse: torb lint --fix --rule bare-case over the repository, the checked code blocks of the docs rewritten by a script, the parser refuses .Case and .member (6.6), ImplicitMember and ImplicitVariant leave the syntax tree, the language pages and the skill updated, the Decision Log entries of 0.1
  • 1b. Case types: Shape.Circle as a type, widening and the one conversion (section 3), as in a pattern (4.2), members and lookup order (section 5), From<Case>, private case refused (7.3 rule 5); one commit, then a seed before the compiler's own source uses it
  • 2. Case bodies and nested cases (1.4, 1.5, 5.2); one commit, then a seed before std or the compiler adopts it
  • 7.3. (the table first: #744) The newtype form for IoError, OsError, DnsError, UriError and the ReadError of std/binary, one package round each; needs no feature of this record and may come first

Phase 3 (narrowing, is) is deferred by the owner and is not a step here.

Dependencies

1a-2 waits for the seed of 1a-1. #168 no longer depends on this epic (owner answer drop).

Each step becomes its own issue when it starts next; the design record stays the specification.

## Context [`docs/design/CLOSED-TRAITS.md`](https://git.torb.dev/torbscript/language/src/branch/main/docs/design/CLOSED-TRAITS.md) is accepted: "phases 1a, 1b and 2 to build; 3 deferred", decided by the owner on 2026-09-28 and 2026-09-29. A `type` with `case` members is the closed trait, a case is a type of its own, and a case is written bare where the expected type names it, so the leading dot goes. The record says "Nothing of this record is implemented yet", and no issue tracks it. ## Source - CLOSED-TRAITS.md section 9 (migration and phases), 9.2 (phase 1a in two commits with the seed between), 9.3 (phases 1b, 2 and 3, and the newtypes of decision 7.3 "before 1.0"), 9.4 (sizes). - Phase 1a is breaking syntax (`.Case` and `.member` are refused after its commit 2), so it has to land before 1.0. ## Steps (epic: no `ready` on this issue) - [ ] 1a-1. (#743) Teach both forms: bare contextual cases resolved by the rule of 6.2 beside `.Case`, the `bare-case` lint rule with its fix, messages, completion and highlighting (tier A and tier B) - [ ] 1a-seed. Refresh and publish the seed after 1a-1 is on `main` (the owner's step) - [ ] 1a-2. Migrate and refuse: `torb lint --fix --rule bare-case` over the repository, the checked code blocks of the docs rewritten by a script, the parser refuses `.Case` and `.member` (6.6), `ImplicitMember` and `ImplicitVariant` leave the syntax tree, the language pages and the skill updated, the Decision Log entries of 0.1 - [ ] 1b. Case types: `Shape.Circle` as a type, widening and the one conversion (section 3), `as` in a pattern (4.2), members and lookup order (section 5), `From<Case>`, `private case` refused (7.3 rule 5); one commit, then a seed before the compiler's own source uses it - [ ] 2. Case bodies and nested cases (1.4, 1.5, 5.2); one commit, then a seed before `std` or the compiler adopts it - [ ] 7.3. (the table first: #744) The newtype form for `IoError`, `OsError`, `DnsError`, `UriError` and the `ReadError` of `std/binary`, one package round each; needs no feature of this record and may come first Phase 3 (narrowing, `is`) is deferred by the owner and is not a step here. ## Dependencies 1a-2 waits for the seed of 1a-1. #168 no longer depends on this epic (owner answer `drop`). _Each step becomes its own issue when it starts next; the design record stays the specification._
Author
Collaborator

[loop:torbscript] re-sweep: filed as homeless work: the accepted record CLOSED-TRAITS.md (phases 1a, 1b and 2 to build) had no issue at all; only #168 referred to phase 1a. Steps follow section 9 of the record. Label loop; an epic carries no ready. Where it sits in ROADMAP.md is not decided here.

[loop:torbscript] re-sweep: filed as homeless work: the accepted record CLOSED-TRAITS.md (phases 1a, 1b and 2 to build) had no issue at all; only #168 referred to phase 1a. Steps follow section 9 of the record. Label `loop`; an epic carries no `ready`. Where it sits in ROADMAP.md is not decided here.
Author
Collaborator

Cleanup audit 2026-11 (#742), what it changes here:

  • Step 1a-1 is cut as #743 (ready). Counted on main today: 11,844 .Case sites in 500 .trb files, 529 in Markdown, 1,027 uses of .member; the record counted about 8,000. The sizes of 9.4 for commit 2 are low by about half.
  • For 1a-2, three places the step text does not name: the fix of the lint rule self-name (it writes .Circle(radius) today, #743 changes it), CONCEPT.md:1421 (still teaches the leading dot) and the Decision Log entry at CONCEPT.md:2698 ("a closed trait ... is not planned").
  • Step 7.3 gets a table first: #744. Eight public error types of std are not classified by decision 7.3, and two counts drifted.

Report: PR #756.

Cleanup audit 2026-11 (#742), what it changes here: - Step 1a-1 is cut as #743 (`ready`). Counted on `main` today: 11,844 `.Case` sites in 500 `.trb` files, 529 in Markdown, 1,027 uses of `.member`; the record counted about 8,000. The sizes of 9.4 for commit 2 are low by about half. - For 1a-2, three places the step text does not name: the fix of the lint rule `self-name` (it writes `.Circle(radius)` today, #743 changes it), `CONCEPT.md:1421` (still teaches the leading dot) and the Decision Log entry at `CONCEPT.md:2698` ("a closed trait ... is not planned"). - Step 7.3 gets a table first: #744. Eight public error types of `std` are not classified by decision 7.3, and two counts drifted. Report: PR #756.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
torbscript/language#713
No description provided.