1
0
Fork 0

use of computed env

This commit is contained in:
Mylloon 2024-04-30 11:53:08 +02:00
parent 71c0a7db93
commit 9c41888ec1
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -42,7 +42,7 @@ let typeof t =
| (Some (Type.Arrow (ty_param, ty_fn)), _), (Some ty_args, _) -> | (Some (Type.Arrow (ty_param, ty_fn)), _), (Some ty_args, _) ->
(* Check if the argument type matches the parameter type *) (* Check if the argument type matches the parameter type *)
(match Unification.unify ty_param ty_args with (match Unification.unify ty_param ty_args with
| Some _ -> Some ty_fn, env | Some env' -> Some ty_fn, env'
| None -> None, env) | None -> None, env)
(* | (Some (Type.Var _ as ty1), _), _ -> (* | (Some (Type.Var _ as ty1), _), _ ->
(* On this case we may have a function represented as a variable *) (* 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 (match Unification.unify ty1 ty2 with
| Some env' -> Some ty2, env' | Some env' -> Some ty2, env'
| _ -> None, env) *) | _ -> None, env) *)
| (Some _, _), _ -> None, env
| _ -> None, env) | _ -> None, env)
in in
fst (infer TypeSubstitution.empty t) fst (infer TypeSubstitution.empty t)