From 47061fb96425f138a62aaf83ecb4a8c4b2201d10 Mon Sep 17 00:00:00 2001 From: Kai Schmidt Date: Sun, 12 Jan 2025 13:34:06 -0800 Subject: [PATCH] fix a data defintion crash --- src/compile/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/compile/mod.rs b/src/compile/mod.rs index e594df85e..34720ee98 100644 --- a/src/compile/mod.rs +++ b/src/compile/mod.rs @@ -1845,7 +1845,9 @@ code: global @ (BindingKind::Module(_) | BindingKind::Scope(_)) => { let names = match &global { BindingKind::Module(m) => &m.names, - BindingKind::Scope(i) => &self.higher_scopes.get(*i).unwrap().names, + BindingKind::Scope(i) => { + &self.higher_scopes.get(*i).unwrap_or(&self.scope).names + } _ => unreachable!(), }; if let Some(local) = names.get("Call").or_else(|| names.get("New")) {