Skip to content

Commit

Permalink
fix a data defintion crash
Browse files Browse the repository at this point in the history
  • Loading branch information
kaikalii committed Jan 12, 2025
1 parent 4b1d596 commit 47061fb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/compile/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")) {
Expand Down

0 comments on commit 47061fb

Please sign in to comment.