diff --git a/lang/src/son.rs b/lang/src/son.rs index 1cc2346..a4131d4 100644 --- a/lang/src/son.rs +++ b/lang/src/son.rs @@ -4104,7 +4104,9 @@ impl<'a> Codegen<'a> { self.report(pos, "function instance has too many arguments"); return None; }; + let prev_file = mem::replace(&mut self.ci.file, file); let ret = self.ty(ret); + self.ci.file = prev_file; self.ci.scope.vars.drain(base..).for_each(|v| v.remove(&mut self.ci.nodes));