tobogganSe connecter

louise

The Louise language: compiler, runtime, std, tooling

Clone avec HTTPS, un jeton personnel en mot de passe, ou avec SSH, une clé ajoutée dans vos paramètres.

Types: Core follows inference's field and HTML decisions inside GADT arms (issue #235)

Inside a GADT arm, inference decides a field's index and how an HTML
hole is built from the *refined* type (`shallow` follows the arm's
equalities), but Core decided again from the *stored* type, which is the
arm's unrefined rigid:
- `v.y` with `v: a` refined to a record read field 0: a silent wrong value;
- an Int or Bool attribute became a String attribute, and a String child
  a `Show` child with no dictionary: `tl_html_escape` panics at run time.

Inference now records each decision where it makes it
(`BodyResults::sites`: field indices, and an `HtmlHole` per attribute or
child), and Core reads it instead of re-inspecting types.
`FnInfer::finish` returns the body's results as one `Inferred` value
instead of a six-element tuple.

Associated types (#234) would make types that reduce only inside an arm
more frequent, so this lands first, in the #233 stack.

- `tests/run/gadt_sites.lse` (both backends) covers each site inside
  GADT arms; it fails on the previous compiler (`1`, then a panic).
- The generated C of every other program in tests/run, tests/bench,
  tests/stress and examples/http_demo is byte-identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

olivier · il y a 1 mois · 661e9a67c1de84bf323053f4c8760469dcff1fac

Parents 9cc774b

5 fichiers modifiés, 216 ajouts, 81 suppressions

Mcrates/louise_core/src/lower/html.rs+22−34
Mcrates/louise_core/src/lower/mod.rs+18−20
Mcrates/louise_types/src/infer/mod.rs+93−19