diff --git a/flap/src/hopix/hopixTypechecker.ml b/flap/src/hopix/hopixTypechecker.ml index 9b5e0e5..a32f3aa 100644 --- a/flap/src/hopix/hopixTypechecker.ml +++ b/flap/src/hopix/hopixTypechecker.ml @@ -138,7 +138,18 @@ and synth_record -> (label Position.located * expression Position.located) list -> ty Position.located list option -> HopixTypes.aty = - fun tenv field tlist -> failwith "Students! This is your job! (synth_record)" + fun tenv field tlist -> + let fl = fst (List.hd field) in + let cons, _, _ = + HopixTypes.lookup_type_constructor_of_label fl.position fl.value tenv + in + let tlist' = + match tlist with + | Some tlist -> List.map (fun t -> HopixTypes.internalize_ty tenv t) tlist + | None -> HopixTypes.type_error fl.position "No types ??" + in + (* TODO: Typecheck *) + ATyCon (cons, tlist') and synth_fun : HopixTypes.typing_environment -> pattern Position.located