anchor.diff:                            match t.n with
                             | Tm_arrow(bs_expected, c_expected) ->
                               let bs_expected, c_expected = SS.open_comp bs_expected c_expected in
  -                            let (env_bs_bs', bs', more, guard_env_bs, subst) = check_binders env_bs more_bs bs_expected in
  -                            let guard'_env = Env.close_guard env_bs bs guard_env_bs in
  +                            let (env_bs_bs', bs', more, guard'_env_bs, subst) = check_binders env_bs more_bs bs_expected in
  +                            let guard'_env = Env.close_guard env_bs bs guard'_env_bs in
                               handle_more (env_bs_bs', bs@bs', more, Env.conj_guard guard_env guard'_env, subst) c_expected body
                             | _ ->
                               let body = U.abs more_bs body None in
  
positive.code:     in
  
      let guard = if env.top_level || not(Env.should_verify env)
                  then Rel.discharge_guard env (Env.conj_guard g_env (Env.close_guard envbody bs guard))
                  else let guard = Env.close_guard env (bs@letrec_binders) (Env.conj_guard g_env guard) in
                       guard in
  
      let guard = TcUtil.close_guard_implicits env bs guard in
      let tfun_computed = U.arrow bs cbody in
      let e = U.abs bs body (Some (U.residual_comp_of_comp (dflt cbody c_opt))) in
      let e, tfun, guard = match tfun_opt with
  
negative.code:               | Tm_app({n=Tm_uvar _}, _) ->
                  (* expected a uvar; build a function type from the term and unify with it *)
                  let _ = match env.letrecs with | [] -> () | _ -> failwith "Impossible" in
                  let bs, envbody, g_env, _ = tc_binders env bs in
                  let envbody, _ = Env.clear_expected_typ envbody in
                  Some t, bs, [], None, envbody, body, g_env
  
                (* CK: add this case since the type may be f:(a -> M b wp){φ}, in which case I drop the refinement *)
                (* NS: 07/21 dropping the refinement is not sound; we need to check that f validates phi. See Bug #284 *)
                | Tm_refine (b, _) ->
                  let _, bs, bs', copt, env_body, body, g_env = as_function_typ norm b.sort in
                  //we pass type `t` out to check afterwards the full refinement type is respected
                  Some t, bs, bs', copt, env_body, body, g_env
  
                | Tm_arrow(bs_expected, c_expected) ->
                  let bs_expected, c_expected = SS.open_comp bs_expected c_expected in
  