From 32374064305f0b2ac927086e44fc6bbf6d086446 Mon Sep 17 00:00:00 2001 From: Nicolas PENELOUX Date: Tue, 28 Nov 2023 21:32:54 +0100 Subject: [PATCH] 40/111 ??? --- flap/src/hopix/hopixTypechecker.ml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/flap/src/hopix/hopixTypechecker.ml b/flap/src/hopix/hopixTypechecker.ml index d315d1c..7f6a001 100644 --- a/flap/src/hopix/hopixTypechecker.ml +++ b/flap/src/hopix/hopixTypechecker.ml @@ -41,7 +41,9 @@ let check_type_scheme -> HopixTypes.aty_scheme * HopixTypes.typing_environment = fun env pos (ForallTy (ts, ty)) -> - failwith "Students! This is your job! (check_type_scheme)" + let ts = List.map Position.value ts in + let env = HopixTypes.bind_type_variables pos env ts in + (HopixTypes.Scheme (ts, HopixTypes.internalize_ty env ty), env) ;; let synth_literal : HopixAST.literal -> HopixTypes.aty = @@ -212,7 +214,9 @@ and check_value_definition (match ty with | None -> failwith "Type missing." | Some ty' -> - failwith "Students! This is your job! (check_value_definition | SimpleValue)") + (*failwith "Students! This is your job! (check_value_definition | SimpleValue)"*) + let tys,_ = Position.located_pos (check_type_scheme env) ty' in + HopixTypes.bind_value (Position.value id) tys env) | RecFunctions _ -> (* Je crois que c'est galère et donc c'est pas grave si on arrive pas à faire les fonctions récursives *)