Skip to content

Commit

Permalink
only look up an identifier as a non-macro if it is a module
Browse files Browse the repository at this point in the history
  • Loading branch information
kaikalii committed Sep 21, 2024
1 parent 74ecee4 commit d236de4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/compile/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1544,7 +1544,14 @@ code:
return Some(local);
}
}
self.find_name(name.strip_suffix('!')?, skip_local)
// Attempt to look up the identifier as a non-macro
let as_non_macro = self.find_name(name.strip_suffix('!')?, skip_local)?;
if let BindingKind::Module(_) = self.asm.bindings[as_non_macro.index].kind {
// Only allow it if it is a module
Some(as_non_macro)
} else {
None
}
}
fn ref_path(
&self,
Expand Down

0 comments on commit d236de4

Please sign in to comment.