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#131 · main · 15 min 54 s
0Étoiles
0Forks
40Issues
Types: derived impls don't constrain phantom parameters (issue #236)
A parameter no constructor stores is phantom: it exists for the compiler
and disappears at runtime. But `@derive(Eq) type Id<tag> { Id(Int) }`
gave `Eq<Id<tag>>` needing `Eq<tag>` anyway, so `Eq<Id<User>>` failed
when `User` wasn't `Eq` — for no reason. The constraints of a derived
impl now cover only parameters of kind Type that some constructor's field
mentions (`collect_impls`, louise_types/src/env/impls.rs). A used
parameter still constrains; constructors that refine or hide types (ADR
0041) are skipped (their types aren't derivable anyway, per
`check_derived`). tests/ui/derives.lse has both cases; ADR 0019 has the
note.Parents a73c744
3 fichiers modifiés, 70 ajouts, 4 suppressions
crates/louise_types/src/env/impls.rs+37−4docs/adr/0019-user-defined-derives.md+14−0tests/ui/derives.lse+19−0