From 7e4a6b91bd33349eb429bb0430c95a39b478cfbf Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 5 Dec 2023 03:59:04 +0100 Subject: [PATCH] essay at synth_tannot --- flap/src/hopix/hopixTypechecker.ml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/flap/src/hopix/hopixTypechecker.ml b/flap/src/hopix/hopixTypechecker.ml index c17f29e..57cd879 100644 --- a/flap/src/hopix/hopixTypechecker.ml +++ b/flap/src/hopix/hopixTypechecker.ml @@ -145,9 +145,11 @@ and synth_tannot : HopixTypes.typing_environment -> expression Position.located -> ty Position.located -> HopixTypes.aty = - fun tenv expr t -> - (* TODO : ici on ne peut pas synthesisé. cf Cours*) - failwith "Students! This is your job! (synth_tannot)" + fun tenv expr ty -> + (* Pas sûr de ça *) + let ty' = synth_expression tenv expr in + check_equal_types expr.position ~expected:(HopixTypes.internalize_ty tenv ty) ~given:ty'; + ty' and synth_field : HopixTypes.typing_environment -> expression Position.located