From 8b98c2ed1becb92046bb7b687ca00813da441248 Mon Sep 17 00:00:00 2001 From: Jakub Doka Date: Sun, 10 Nov 2024 12:26:30 +0100 Subject: [PATCH] fixing different file imports --- lang/src/son.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lang/src/son.rs b/lang/src/son.rs index ca08cbd..bc3df8a 100644 --- a/lang/src/son.rs +++ b/lang/src/son.rs @@ -3816,6 +3816,7 @@ impl<'a> Codegen<'a> { fn gen_const(&mut self, cnst: ty::Const, ctx: Ctx) -> Option { let c = &self.tys.ins.consts[cnst]; + let prev = mem::replace(&mut self.ci.file, c.file); let f = &self.files[c.file.index()]; let Expr::BinOp { left, right, .. } = c.ast.get(f) else { unreachable!() }; @@ -3826,6 +3827,7 @@ impl<'a> Codegen<'a> { }) .unwrap_or_else(|_| unreachable!())?; self.strip_var(&mut value); + self.ci.file = prev; Some(value) }