feat: match guards, HOF inference, ownership C.2/C.3, LSP sema hover

Sessions 18–23 quality work:

- B.3c match arm guards + sequential found-flag lower (bootstrap + selfhost)
- Generic HOF type inference (Array/Iter map/filter/fold without type args)
- Pattern binding shadowing via unique C locals (__pN_src)
- Ownership C.2 exclusive &mut data-flow + C.4 goldens; *p= store-through fix
- Ownership C.3 auto-drop on early return/branches: scoped defers, move-on-return,
  Drop monomorphization, materialize return before Drop
- LSP 0.3.0: hover from real sema types
- Examples and QUALITY_PLAN session log; selfhost-loop identical
This commit is contained in:
2026-07-18 21:52:14 +03:00
parent 66f11d1869
commit 3eb1ad3a82
25 changed files with 2246 additions and 457 deletions
+5 -1
View File
@@ -180,6 +180,8 @@ proc underlineLength(lineText: string, col: uint32, message: string): int =
proc hintForMessage(msg: string): string =
## Actionable help text for common compiler errors.
let m = msg.toLowerAscii()
if "while it is mutably borrowed" in m:
return "only one active '&mut' borrow is allowed at a time; end the borrow before reuse"
if "cannot assign" in m:
return "ensure the right-hand side type matches the left-hand side"
if "undeclared identifier" in m:
@@ -193,7 +195,9 @@ proc hintForMessage(msg: string): string =
if "shared reference" in m or "checked function" in m:
return "use '&mut T' for mutation, or drop @[Checked] for unchecked code"
if "double mutable borrow" in m or "already mutably borrowed" in m:
return "only one active '&mut' borrow is allowed at a time"
return "only one active '&mut' borrow is allowed at a time; end the borrow before reuse"
if "shared-borrow" in m or "shared-borrowed" in m:
return "exclusive '&mut' and shared '&' cannot overlap on the same variable"
if "expected expression" in m:
return "the previous statement may be incomplete (missing value or ';')"
if "expected type" in m: