Merge pull request #5055 from roc-lang/abilities-bug-generic

Lambda set compaction must preserve unique specializations of concrete types
This commit is contained in:
Folkert de Vries 2023-02-21 15:24:23 +01:00 committed by GitHub
commit bd6623dab4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 1083 additions and 57 deletions

View file

@ -4038,6 +4038,33 @@ impl<'a> ProcLayout<'a> {
}
}
}
pub fn dbg_deep<'r, I: LayoutInterner<'a>>(&self, interner: &'r I) -> DbgProcLayout<'a, 'r, I> {
DbgProcLayout {
layout: *self,
interner,
}
}
}
pub struct DbgProcLayout<'a, 'r, I: LayoutInterner<'a>> {
layout: ProcLayout<'a>,
interner: &'r I,
}
impl<'a, 'r, I: LayoutInterner<'a>> std::fmt::Debug for DbgProcLayout<'a, 'r, I> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let ProcLayout {
arguments,
result,
niche,
} = self.layout;
f.debug_struct("ProcLayout")
.field("arguments", &self.interner.dbg_deep_iter(arguments))
.field("result", &self.interner.dbg_deep(result))
.field("niche", &niche.dbg_deep(self.interner))
.finish()
}
}
fn specialize_naked_symbol<'a>(