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.
Dernier runRéussi#126 · main · 9 min 22 s
0Étoiles
0Forks
40Issues
Types: a constructor used as a value takes its fields by position (#320)
Since currying, a constructor's scheme carried its field names as parameter labels: `Peek` used as a value was `fn(~reply: Int) -> Msg`, which unifies with no `fn(Int) -> Msg`. `result.map_error r Bad`, `actor.call s Peek 5000` and `let f = Pair` then `f 1 "one"` were refused. ADR 0062's amendment keeps `~` for a function's labelled parameters only; a field name is not one. - A constructor's scheme is unlabelled (both kinds of constructor). - Construction takes its labels from the constructor's fields, as patterns and Core already do: `Pair(b: "two", a: 2)` is unchanged. - `f ~reply: 1` on a constructor value is E0204 now; nothing in std, the tests, the examples or the packages wrote that. - ADR 0062: construction, update and patterns keep `:`, as amended; a constructor value's type is unlabelled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Parents 61cb616
5 fichiers modifiés, 86 ajouts, 19 suppressions
crates/louise_types/src/env/mod.rs+5−16crates/louise_types/src/infer/mod.rs+9−1docs/adr/0062-parens-free-functions.md+2−2tests/run/constructors_as_values.lse+31−0tests/ui/constructors_as_values.lse+39−0