Skip to content

Commit 434b5ad

Browse files
committed
chore: pass TypeValidator as dyn to avoid excessive monomorphisation
1 parent 71f589b commit 434b5ad

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

compiler/src/typer.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ impl<'ctx, 'scope, 'id> TypeEnv<'ctx, 'scope, 'id> {
851851
fn resolve_infer_type(
852852
&self,
853853
name: &TypeName,
854-
validator: &impl TypeValidator<'id>,
854+
validator: &dyn TypeValidator<'id>,
855855
) -> Result<InferType<'id>, TypeError<'id>> {
856856
let ty = self.resolve_type(name, validator)?;
857857
Ok(InferType::from_type(&ty, self.vars))
@@ -867,7 +867,7 @@ impl<'ctx, 'scope, 'id> TypeEnv<'ctx, 'scope, 'id> {
867867
pub fn resolve_type(
868868
&self,
869869
name: &TypeName,
870-
validator: &impl TypeValidator<'id>,
870+
validator: &dyn TypeValidator<'id>,
871871
) -> Result<Type<'id>, TypeError<'id>> {
872872
if self.vars.get(name.name()).is_some() {
873873
Ok(Type::Var(VarName::Named(name.name().clone())))
@@ -892,7 +892,7 @@ impl<'ctx, 'scope, 'id> TypeEnv<'ctx, 'scope, 'id> {
892892
pub fn resolve_param_type(
893893
&self,
894894
name: &TypeName,
895-
validator: &impl TypeValidator<'id>,
895+
validator: &dyn TypeValidator<'id>,
896896
) -> Result<Parameterized<'id>, TypeError<'id>> {
897897
let id = self.resolve_type_id(name.name())?;
898898
let args = name
@@ -908,7 +908,7 @@ impl<'ctx, 'scope, 'id> TypeEnv<'ctx, 'scope, 'id> {
908908
pub fn instantiate_var(
909909
&self,
910910
var: &TypeParam,
911-
validator: &impl TypeValidator<'id>,
911+
validator: &dyn TypeValidator<'id>,
912912
) -> Result<TypeVar<'id>, TypeError<'id>> {
913913
let var = TypeVar {
914914
name: var.name.clone(),

0 commit comments

Comments
 (0)