This commit is contained in:
Mylloon 2023-12-04 22:58:47 +01:00
parent 581185838d
commit ee1baae420
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -115,10 +115,10 @@ and synth_apply
(*failwith "Students! This is your job! (synth_apply)"*)
let f_type = synth_expression tenv f in
match f_type with
| HopixTypes.ATyArrow (gauche, droit) ->
| HopixTypes.ATyArrow (expected, droit) ->
(* a' -> b' *)
let x_type = synth_expression tenv x in
check_equal_types x.position gauche x_type;
let given = synth_expression tenv x in
check_equal_types x.position ~expected ~given;
droit
| _ -> failwith ""
@ -158,25 +158,13 @@ and synth_sequence
: HopixTypes.typing_environment -> expression Position.located list -> HopixTypes.aty
=
fun tenv elist ->
<<<<<<< HEAD
match elist with
| [] -> failwith "erreur sequence"
| [x] -> synth_expression tenv x
| x::l ->
(
let x_type = synth_expression tenv x in
check_equal_types x.position HopixTypes.hunit x_type
; synth_sequence tenv l)
=======
match elist with
| [] -> failwith "erreur sequence"
| [ x ] -> synth_expression tenv x
| x :: l ->
let x_type = synth_expression tenv x in
check_equal_types x.position HopixTypes.hunit x_type;
let given = synth_expression tenv x in
check_equal_types x.position ~expected:HopixTypes.hunit ~given;
synth_sequence tenv l
>>>>>>> a4910af26df56be5421c82c370bfcb6cdafae1fd
and synth_define
: HopixTypes.typing_environment -> value_definition -> expression Position.located