Don't eagerly walk down let bindings to specialize an ability

This commit is contained in:
Ayaz Hafiz 2022-05-06 09:10:26 -04:00 committed by ayazhafiz
parent e5eae75ad6
commit 645c0f2738

View file

@ -2504,6 +2504,12 @@ fn resolve_abilities_in_specialized_body<'a>(
// are themselves specialized, so we'll handle ability resolution in them at
// that time too.
}
Expr::LetRec(..) | Expr::LetNonRec(..) => {
// Also don't walk down let-bindings. These may be generalized and we won't
// know their specializations until we collect them while building up the def.
// So, we'll resolve any nested abilities when we know their specialized type
// during def construction.
}
Expr::AbilityMember(member_sym, specialization_cell) => {
let mut specialization_cell = specialization_cell
.write()