From f44b7a585ee382e3bdc0cf538f68a402c1a5b807 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 5 Dec 2023 12:10:00 +0100 Subject: [PATCH] synth_variable Some case --- flap/src/hopix/hopixTypechecker.ml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/flap/src/hopix/hopixTypechecker.ml b/flap/src/hopix/hopixTypechecker.ml index debc113..9b5e0e5 100644 --- a/flap/src/hopix/hopixTypechecker.ml +++ b/flap/src/hopix/hopixTypechecker.ml @@ -106,7 +106,12 @@ and synth_variable in match tlist with | None -> HopixTypes.instantiate_type_scheme ty [] - | Some _ -> failwith "Students! This is your job! (synth_variable | tlist | Some)" + | Some tlist' -> + (* Pas testé *) + let atlist = List.map (fun t -> HopixTypes.internalize_ty tenv t) tlist' in + (try HopixTypes.instantiate_type_scheme ty atlist with + | HopixTypes.InvalidInstantiation { expected; given } -> + invalid_instantiation id.position expected given) and synth_tagged : HopixTypes.typing_environment -> constructor Position.located