177. Dream gaps get one error that names the construct (2026-11-21)
- Decision. Each class of dream construct the front end does not have is reported once, at the construct, as
E0504"not implemented yet: (see design/…)" or "(not in the design)": a domain parameterfn f<domain D>, several domains on onedomainline, a value on the indented lines after=, a line continued by an indented operator line, statements in parentheses(a; b), the range spellinglo <.. hi, a domain used as a value, the cuts of a domain spelledD.Cut(design §21.4; todayD.bounds), an operator used as a value (compose: +, designstdlib/ranges.md§6.1; read as an error node), and avarbinding inside a pattern ((var a, b); the binding is read as a plain name and its mutability is not checked, so the one error is thevar). Planned forms met while the parser speculates are queued and reported only if that branch is kept.Sink::finishkeeps only the firstE0504per message, since every later use of the feature is the same root cause. An unknown type close to a built-in or stdlib type says "not in the stdlib (yet)" beside the did-you-mean; a type used as a value is reported as a back-end limitation. - Why. The dream gate counted 29/60 dreams whose first error named the missing capability; generic "expected X" and mismatch errors hid what each dream needs. Each fix is a class of construct with a golden in
crates/cpl-cli/tests/diagnostics/. - Reverse. Drop the entries from
PLANNEDincrates/cpl-syntax/src/planned.rswith their parser/checker call sites, thespeculative_plannedqueue incrates/cpl-syntax/src/parser.rs, theE0504dedup inSink::finish, and theDim::Enumarm inLowerer::list. - Addendum. More classes are named the same way:
matcharms on thematchline (match x: 0 => a; _ => b, read into real arms),let … in, maps{k: v}and sets{x for x in xs}in braces,m default 0,lazy[D] i => …,domain A = V if p(v), a pattern in place of a parameter name (fn f((r, c): Pt), design §14.1; the parameter binds and the pattern is unpacked on the body's first line, so later errors surface),some xpatterns,[_]T,a <=> b then c <=> d,.memberwithout its type, and types of literal values ('+' | '-'). A contextwith io(...)says "not implemented yet, and deferred" (DEFERREDinplanned.rs). An indentediformatchafter=is the value (the core lane implemented it); any other indented value stays planned.let mut xis read asvar xwith a fix, andmutin aletcondition is an error whose fix removes it. A capitalized unknown name is offered only capitalized names, since it is a type or a variant. Why: the owner's dream buckets (indented arms, stray tokens,?in a branch, contexts); the gate went from 64/84 first errors and 167/219 errors named to 68/84 and 182/219. Reverse: drop the entries and their call sites,DEFERREDwithPlanned::deferred, and thelet mutand label arms instmt.rs,pattern.rsanditem.rs.