todo
This commit is contained in:
parent
91e62c04f6
commit
b809467cff
1 changed files with 2 additions and 1 deletions
|
@ -35,9 +35,10 @@ let typeof t =
|
|||
| None, _ -> Some (Type.Arrow (Type.Var id, ty_body)), env')
|
||||
| _ -> None, env)
|
||||
| Term.App (t1, t2) ->
|
||||
(* Check if the function type matches the arguments *)
|
||||
(* TODO: When a variable is a function *)
|
||||
(match infer env t1, infer env t2 with
|
||||
| (Some (Type.Arrow (ty_param, ty_fn)), _), (Some ty_args, _) ->
|
||||
(* Check if the function type matches the arguments *)
|
||||
(match Unification.unify ty_param ty_args with
|
||||
| Some _ -> Some ty_fn, env
|
||||
| None -> None, env)
|
||||
|
|
Reference in a new issue