check: refuse at check time what no back end lowers #746
Labels
No labels
loop
queue/failed
queue/queued
ready
status/parked
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
torbscript/language#746
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Context
torb checkaccepts programs thattorb buildandtorb runthen refuse in the lowering. From the audit, each of these is a message ofcompiler/src/ir/lower/: an assignment to a top-levelvarfrom a function; a read through a top-levelvarfrom a function; an assignment to a captured binding; the negation of an unsigned number; an operator with avarreceiver; avarparameter that takes its default (call.trb:1430); alazyparameter that takes its default (call.trb:1435); a call of a function value that leaves a defaulted parameter out (closure.trb:989); a closure that captures the slot of afor var(closure.trb:1128); aspawnclosure that shares a variable (closure.trb:1290);while varover alternatives whose names are paths into different cases; the export of a function with avarparameter. The editor shows no problem for them, and CONCEPT promises that a program which type checks builds.Source
docs/project/2026-11-cleanup-audit.md.Goal
Each construct on the user-reachable list either builds on tier A and tier B, or the checker refuses it with a message that names the rule and the way out. After this issue the list of user-reachable unsupported constructs holds only back-end-specific entries (JavaScript, PHP), which their allow lists track.
Design record point
CONCEPT (the sections on
varparameters, closures and captures,spawn);docs/TYPECHECKER.mdsection 9 gets one spec gap entry per construct that is refused for good.Acceptance criteria
reportUnsupportedon tier A or tier B any moreDependencies
After #745 (its list is the input). May be cut into one PR per group (top-level
var, defaults, captures) when it starts.Seed
None expected. A refusal that the compiler's own source violates would need the two-commit rule; report it in the PR instead of working around it.
Size
Two or three PRs of one or two commits each; split by group when the issue is refined.