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: 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.

olivier · il y a 1 mois · a58d586dfd0fd67a614c578fae09f98f8086c114

Parents a73c744

3 fichiers modifiés, 70 ajouts, 4 suppressions