From c41d137715760e40bf918a63d4c5513ada563449 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 28 Nov 2023 03:29:02 +0100 Subject: [PATCH] no type = fail --- 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 adb8c2b..d315d1c 100644 --- a/flap/src/hopix/hopixTypechecker.ml +++ b/flap/src/hopix/hopixTypechecker.ml @@ -208,13 +208,15 @@ and check_value_definition -> HopixTypes.typing_environment = fun env -> function - | SimpleValue (id, Some ty, ex) -> - failwith "Students! This is your job! (check_value_definition | SimpleValue)" + | SimpleValue (id, ty, ex) -> + (match ty with + | None -> failwith "Type missing." + | Some ty' -> + failwith "Students! This is your job! (check_value_definition | SimpleValue)") | RecFunctions _ -> (* Je crois que c'est galère et donc c'est pas grave si on arrive pas à faire les fonctions récursives *) failwith "Students! This is your job! (check_value_definition | RecFunctions)" - | _ -> failwith "Students! This is your job!" ;; let check_definition env = function