From 9c41888ec147cea4570a2a1c1489589b0da4a4f0 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 30 Apr 2024 11:53:08 +0200 Subject: [PATCH] use of computed env --- lib/inference.ml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/inference.ml b/lib/inference.ml index f06b55c..905c94d 100644 --- a/lib/inference.ml +++ b/lib/inference.ml @@ -42,7 +42,7 @@ let typeof t = | (Some (Type.Arrow (ty_param, ty_fn)), _), (Some ty_args, _) -> (* Check if the argument type matches the parameter type *) (match Unification.unify ty_param ty_args with - | Some _ -> Some ty_fn, env + | Some env' -> Some ty_fn, env' | None -> None, env) (* | (Some (Type.Var _ as ty1), _), _ -> (* On this case we may have a function represented as a variable *) @@ -50,7 +50,6 @@ let typeof t = (match Unification.unify ty1 ty2 with | Some env' -> Some ty2, env' | _ -> None, env) *) - | (Some _, _), _ -> None, env | _ -> None, env) in fst (infer TypeSubstitution.empty t)