mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-03 18:29:00 +00:00
fix: closure bug
This commit is contained in:
parent
439ba1d28e
commit
962e010c29
3 changed files with 23 additions and 0 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue