diff --git a/fathom/src/surface.rs b/fathom/src/surface.rs index 52d779960..5d6f10a5d 100644 --- a/fathom/src/surface.rs +++ b/fathom/src/surface.rs @@ -186,7 +186,7 @@ pub enum Term<'arena, Range> { /// Let expressions. Let( Range, - Pattern<'arena, Range>, + &'arena Pattern<'arena, Range>, Option<&'arena Term<'arena, Range>>, &'arena Term<'arena, Range>, &'arena Term<'arena, Range>, @@ -524,8 +524,8 @@ mod tests { #[test] #[cfg(target_pointer_width = "64")] fn term_size() { - assert_eq!(std::mem::size_of::>(), 48); - assert_eq!(std::mem::size_of::>(), 72); + assert_eq!(std::mem::size_of::>(), 40); + assert_eq!(std::mem::size_of::>(), 48); } #[test] diff --git a/fathom/src/surface/distillation.rs b/fathom/src/surface/distillation.rs index 10369e38e..edaee5f4c 100644 --- a/fathom/src/surface/distillation.rs +++ b/fathom/src/surface/distillation.rs @@ -255,7 +255,7 @@ impl<'interner, 'arena, 'env> Context<'interner, 'arena, 'env> { Term::Let( (), - Pattern::Name((), def_name), + self.scope.to_scope(Pattern::Name((), def_name)), Some(self.scope.to_scope(def_type)), self.scope.to_scope(def_expr), self.scope.to_scope(body_expr), @@ -476,7 +476,7 @@ impl<'interner, 'arena, 'env> Context<'interner, 'arena, 'env> { Term::Let( (), - Pattern::Name((), def_name), + self.scope.to_scope(Pattern::Name((), def_name)), Some(self.scope.to_scope(def_type)), self.scope.to_scope(def_expr), self.scope.to_scope(body_expr), diff --git a/fathom/src/surface/grammar.lalrpop b/fathom/src/surface/grammar.lalrpop index 33ccbb0f8..cd4ee6d01 100644 --- a/fathom/src/surface/grammar.lalrpop +++ b/fathom/src/surface/grammar.lalrpop @@ -121,7 +121,7 @@ LetTerm: Term<'arena, ByteRange> = { "let" )?> "=" ";" => { Term::Let( ByteRange::new(file_id, start, end), - def_pattern, + scope.to_scope(def_pattern), def_type.map(|def_type| scope.to_scope(def_type) as &_), scope.to_scope(def_expr), scope.to_scope(body_expr),