ocaml: phase 1 type annotations on let / (e : T) (+4 tests, 473 total)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 25s

let NAME [PARAMS] : T = expr and (expr : T) parse and skip the type
source. Runtime no-op since SX is dynamic. Works in inline let,
top-level let, and parenthesised expressions:

  let x : int = 5 ;; x + 1                        -> 6
  let f (x : int) : int = x + 1 in f 41           -> 42
  (5 : int)                                       -> 5
  ((1 + 2) : int) * 3                             -> 9
This commit is contained in:
2026-05-08 20:58:50 +00:00
parent ce75bd6848
commit a4ef9a8ec9
3 changed files with 60 additions and 1 deletions

View File

@@ -407,6 +407,11 @@ _Newest first._
binary search tree (`type 'a tree = Leaf | Node of 'a * 'a tree *
'a tree`) with insert + in-order traversal. Tests parametric ADT,
recursive match, List.append, List.fold_left.
- 2026-05-08 Phase 1 — type annotations on let-bindings and parens
expressions (+4 tests, 473 total). `let NAME [PARAMS] : T = expr`
and `(expr : T)` parse and skip the type source. Runtime no-op
(dynamic). Works in inline let, top-level let, and parenthesised
expressions: `let f (x : int) : int = x + 1 in f 41`.
- 2026-05-08 Phase 1+5.1 — type aliases + poly_stack baseline (+3
tests, 469 total + 19 baseline). Parser dispatch on the post-`=`
token: `|` or `Ctor` → sum, `{` → record, otherwise → alias (skip