fix: closure bug

This commit is contained in:
Shunsuke Shibayama 2023-11-18 19:43:06 +09:00
parent 439ba1d28e
commit 962e010c29
3 changed files with 23 additions and 0 deletions

View file

@ -1382,6 +1382,16 @@ impl Context {
None
}
pub fn current_function_ctx(&self) -> Option<&Context> {
if self.kind.is_subr() {
Some(self)
} else if let Some(outer) = self.get_outer() {
outer.current_function_ctx()
} else {
None
}
}
pub(crate) fn check_types(&self) {
if DEBUG_MODE {
for (_, ctx) in self.poly_types.iter() {