Skip to content

Commit 6d8a309

Browse files
committed
Fix tiny issue with test
1 parent 49b5d23 commit 6d8a309

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/compiler.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1592,7 +1592,8 @@ impl Compiler {
15921592
fn compile_call(&mut self, items: &[Value], dest: Reg, tail_pos: bool) -> Result<(), String> {
15931593
// Try constant folding for the entire call expression (including pure user functions)
15941594
// NOTE: Don't constant-fold qualified names (module/function) to preserve module privacy
1595-
let is_module_call = items[0].as_symbol().map_or(false, |s| s.contains('/'));
1595+
// A qualified name has format "module/name" (contains / but is not just "/")
1596+
let is_module_call = items[0].as_symbol().map_or(false, |s| s.len() > 1 && s.contains('/'));
15961597
if !is_module_call {
15971598
let call_expr = Value::list(items.to_vec());
15981599
if let Some(folded) = try_const_eval_with_fns(&call_expr, &self.pure_fns) {
@@ -1647,7 +1648,8 @@ impl Compiler {
16471648
// This eliminates call overhead for thin wrappers like:
16481649
// (def reverse (fn (lst) (reverse-acc lst (list))))
16491650
// NOTE: Don't inline qualified names (module/function) to preserve module privacy
1650-
if !op.contains('/') {
1651+
// A qualified name has format "module/name" (contains / but is not just "/")
1652+
if !(op.len() > 1 && op.contains('/')) {
16511653
if let Some(fn_def) = self.inline_candidates.get(op).cloned() {
16521654
// Check: correct number of arguments
16531655
if args.len() == fn_def.params.len() {

0 commit comments

Comments
 (0)