diff --git a/flap/src/hopix/hopixTypechecker.ml b/flap/src/hopix/hopixTypechecker.ml index 694c74f..594ace2 100644 --- a/flap/src/hopix/hopixTypechecker.ml +++ b/flap/src/hopix/hopixTypechecker.ml @@ -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