synth_variable Some case

This commit is contained in:
Mylloon 2023-12-05 12:10:00 +01:00
parent 4492c9b3ea
commit f44b7a585e
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -106,7 +106,12 @@ and synth_variable
in in
match tlist with match tlist with
| None -> HopixTypes.instantiate_type_scheme ty [] | 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 and synth_tagged
: HopixTypes.typing_environment -> constructor Position.located : HopixTypes.typing_environment -> constructor Position.located