This commit is contained in:
Mylloon 2023-12-05 00:06:30 +01:00
parent a4ea0f62d2
commit 28f303ee51
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -106,7 +106,7 @@ and synth_variable
in
match tlist with
| None -> HopixTypes.instantiate_type_scheme ty []
| Some _ -> failwith "Students! This is your job! (synth_variable tlist not None)"
| Some _ -> failwith "Students! This is your job! (synth_variable | tlist | None)"
and synth_tagged
: HopixTypes.typing_environment -> constructor Position.located
@ -119,7 +119,6 @@ and synth_apply
-> expression Position.located -> HopixTypes.aty
=
fun tenv f x ->
(*failwith "Students! This is your job! (synth_apply)"*)
let f_type = synth_expression tenv f in
match f_type with
| HopixTypes.ATyArrow (expected, droit) ->
@ -228,7 +227,7 @@ and check_expression
=
fun env (Position.{ value = e; position = pos } as exp) expected ->
match e with
| Fun df -> failwith "Students! This is your job! Fun check"
| Fun df -> failwith "Students! This is your job! (check_expression | Fun)"
| _ ->
let given = synth_expression env exp in
check_equal_types pos ~expected ~given
@ -242,7 +241,6 @@ and check_value_definition
(match ty with
| None -> failwith "A type is missing."
| Some ty' ->
(*failwith "Students! This is your job! (check_value_definition | SimpleValue)"*)
let tys, tenv = Position.located_pos (check_type_scheme env) ty' in
check_expression tenv ex (HopixTypes.instantiate_type_scheme tys []);
HopixTypes.bind_value (Position.value id) tys env)