wip: record
This commit is contained in:
parent
f44b7a585e
commit
4266ff5111
1 changed files with 12 additions and 1 deletions
|
@ -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
|
||||
|
|
Reference in a new issue