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