1
0
Fork 0
This commit is contained in:
Mylloon 2024-04-27 12:41:50 +02:00
parent 040ff8570f
commit 11511ab0a2
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -39,13 +39,13 @@ let typeof t =
(match Unification.unify ty_param ty_args with
| Some _ -> Some ty_fn, env
| None -> None, env)
| (Some _ (* (Type.Var _ as ty1) *), _), _ ->
(* On this case we may have a function represented as the variable *)
(* let ty2 = Type.Arrow (ty1, ty1) in
(match Unification.unify ty1 ty2 with
| Some env' -> Some ty2, env'
| _ -> None, env) *)
None, env
(* | (Some (Type.Var _ as ty1), _), _ ->
(* On this case we may have a function represented as the variable *)
let ty2 = Type.Arrow (ty1, ty1) in
(match Unification.unify ty1 ty2 with
| Some env' -> Some ty2, env'
| _ -> None, env) *)
| (Some _, _), _ -> None, env
| _ -> None, env)
in
fst (infer TypeSubstitution.empty t)