use of computed env
This commit is contained in:
parent
71c0a7db93
commit
9c41888ec1
1 changed files with 1 additions and 2 deletions
|
@ -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)
|
||||||
|
|
Reference in a new issue