diff --git a/src/node.zig b/src/node.zig index f3889911..4c6f34e3 100644 --- a/src/node.zig +++ b/src/node.zig @@ -283,7 +283,7 @@ pub const ExpressionNode = struct { try codegen.emitOpCode(node.location, .OP_POP); - if (self.isLoneExpression() and self.expression.type_def.?.def_type != .Placeholder) { + if (codegen.flavor != .Repl and self.isLoneExpression() and self.expression.type_def.?.def_type != .Placeholder) { const type_def_str = self.expression.type_def.?.toStringAlloc(codegen.gc.allocator) catch unreachable; defer type_def_str.deinit(); diff --git a/src/parser.zig b/src/parser.zig index fc733103..7c97d305 100644 --- a/src/parser.zig +++ b/src/parser.zig @@ -660,7 +660,7 @@ pub const Parser = struct { const local = self.current.?.locals[i]; // Check discarded locals - if (!local.isReferenced()) { + if (self.flavor != .Repl and !local.isReferenced()) { const type_def_str = local.type_def.toStringAlloc(self.gc.allocator) catch unreachable; defer type_def_str.deinit(); @@ -720,7 +720,7 @@ pub const Parser = struct { } // Check discarded locals - if (!local.isReferenced()) { + if (self.flavor != .Repl and !local.isReferenced()) { const type_def_str = local.type_def.toStringAlloc(self.gc.allocator) catch unreachable; defer type_def_str.deinit();