synth_while
This commit is contained in:
parent
45bbd6a0dd
commit
419e3e962e
1 changed files with 6 additions and 1 deletions
|
@ -230,7 +230,12 @@ and synth_while
|
|||
: HopixTypes.typing_environment -> expression Position.located
|
||||
-> expression Position.located -> HopixTypes.aty
|
||||
=
|
||||
fun tenv ecase expr -> failwith "Students! This is your job! (synth_while)"
|
||||
fun tenv ecase c ->
|
||||
let ecasety = synth_expression tenv ecase in
|
||||
check_equal_types ecase.position ~expected:ecasety ~given:HopixTypes.hbool;
|
||||
let exprty = synth_expression tenv c in
|
||||
check_equal_types c.position ~expected:exprty ~given:HopixTypes.hunit;
|
||||
HopixTypes.hunit
|
||||
|
||||
and synth_for
|
||||
: HopixTypes.typing_environment -> identifier Position.located
|
||||
|
|
Reference in a new issue