mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-28 04:09:05 +00:00
fix: infinite recursion bug
This commit is contained in:
parent
50cfc43081
commit
cd9973e800
2 changed files with 14 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue