fix: ownership bug

This commit is contained in:
Shunsuke Shibayama 2024-02-07 19:50:50 +09:00
parent c76de00847
commit 36fcc8cb79
5 changed files with 46 additions and 15 deletions

View file

@ -2212,6 +2212,13 @@ impl Signature {
Self::Subr(s) => Some(&mut s.params),
}
}
pub fn captured_names(&self) -> &[Identifier] {
match self {
Self::Var(_) => &[],
Self::Subr(s) => &s.captured_names,
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]