fix: infinite recursion bug

This commit is contained in:
Shunsuke Shibayama 2024-08-11 14:17:04 +09:00
parent 50cfc43081
commit cd9973e800
2 changed files with 14 additions and 0 deletions

View file

@ -551,6 +551,9 @@ pub struct Free<T: Send + Clone>(Forkable<FreeKind<T>>);
impl Hash for Free<Type> {
fn hash<H: Hasher>(&self, state: &mut H) {
if self.0.dec_recursion_counter() == 1 {
return;
}
if let Some(name) = self.unbound_name() {
name.hash(state);
}