synth_ifthenelse
This commit is contained in:
parent
9d077bcbc1
commit
45bbd6a0dd
1 changed files with 9 additions and 1 deletions
|
@ -216,7 +216,15 @@ and synth_ifthenelse
|
||||||
: HopixTypes.typing_environment -> expression Position.located
|
: HopixTypes.typing_environment -> expression Position.located
|
||||||
-> expression Position.located -> expression Position.located -> HopixTypes.aty
|
-> expression Position.located -> expression Position.located -> HopixTypes.aty
|
||||||
=
|
=
|
||||||
fun tenv ecase eif eelse -> failwith "Students! This is your job! (synth_ifthenelse)"
|
fun tenv ecase eif eelse ->
|
||||||
|
(* Pas testé !! *)
|
||||||
|
let ecasety = synth_expression tenv ecase in
|
||||||
|
check_equal_types ecase.position ~expected:ecasety ~given:HopixTypes.hbool;
|
||||||
|
let eifty = synth_expression tenv eif in
|
||||||
|
check_equal_types eif.position ~expected:eifty ~given:HopixTypes.hunit;
|
||||||
|
let eelsety = synth_expression tenv eelse in
|
||||||
|
check_equal_types eelse.position ~expected:eelsety ~given:HopixTypes.hunit;
|
||||||
|
HopixTypes.hunit
|
||||||
|
|
||||||
and synth_while
|
and synth_while
|
||||||
: HopixTypes.typing_environment -> expression Position.located
|
: HopixTypes.typing_environment -> expression Position.located
|
||||||
|
|
Reference in a new issue