1
0
Fork 0
This commit is contained in:
Mylloon 2024-04-30 11:47:21 +02:00
parent 32cc3ba032
commit 71c0a7db93
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -22,6 +22,11 @@ let typeof t =
(match proj with (match proj with
| Term.First -> Some ty1, env | Term.First -> Some ty1, env
| Term.Second -> Some ty2, env) | Term.Second -> Some ty2, env)
| Some (Type.Var id), env' ->
(* Variable is a product *)
(match TypeSubstitution.find id env' with
| Some ty -> Some ty, env'
| None -> None, env')
| _ -> None, env) | _ -> None, env)
| Term.Fun (id, body) -> | Term.Fun (id, body) ->
let arg = TypeSubstitution.singleton id (Type.Var id) in let arg = TypeSubstitution.singleton id (Type.Var id) in