diff --git a/flap/src/hopix/hopixTypechecker.ml b/flap/src/hopix/hopixTypechecker.ml index 017134e..c07e501 100644 --- a/flap/src/hopix/hopixTypechecker.ml +++ b/flap/src/hopix/hopixTypechecker.ml @@ -191,7 +191,13 @@ and synth_assign : HopixTypes.typing_environment -> expression Position.located -> expression Position.located -> HopixTypes.aty = - fun tenv ref expr -> failwith "Students! This is your job! (synth_assign)" + fun tenv ref expr -> + let refty = synth_expression tenv ref in + match HopixTypes.destruct_reference_type expr.position refty with + | expected -> + let given = synth_expression tenv expr in + check_equal_types expr.position ~expected ~given; + HopixTypes.hunit and synth_read : HopixTypes.typing_environment -> expression Position.located -> HopixTypes.aty