Skip to content

Commit

Permalink
tyck: Clean up implementation of widen
Browse files Browse the repository at this point in the history
  • Loading branch information
CohenArthur committed Aug 29, 2024
1 parent 21937e3 commit 59e8dae
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions typecheck/src/widen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ fn widen_inner(
}
}

pub fn widen(fir: &Fir<FlattenData<'_>>, mut type_ctx: TypeCtx<TypeMap>) -> TypeCtx<TypeMap> {
let primitives = core::mem::take(&mut type_ctx.primitives);
pub fn widen(fir: &Fir<FlattenData<'_>>, type_ctx: TypeCtx<TypeMap>) -> TypeCtx<TypeMap> {
let types = type_ctx
.types
.types
Expand All @@ -49,5 +48,8 @@ pub fn widen(fir: &Fir<FlattenData<'_>>, mut type_ctx: TypeCtx<TypeMap>) -> Type
tymap
});

TypeCtx { primitives, types }
TypeCtx {
primitives: type_ctx.primitives,
types,
}
}

0 comments on commit 59e8dae

Please sign in to comment.