anchor.diff:                                (Print.term_to_string ctx_u.ctx_uvar_typ)
                                 reason
                                 (Range.string_of_range r);
  +
                 let g =
                   Errors.with_ctx (BU.format3 "While checking implicit %s set to %s of expected type %s"
                                                 (Print.uvar_to_string ctx_u.ctx_uvar_head)
                                                 (N.term_to_string env tm)
                                                 (N.term_to_string env ctx_u.ctx_uvar_typ))
  -                                (fun () -> env.check_type_of must_total env tm ctx_u.ctx_uvar_typ)
  +                                (fun () -> env.check_type_and_effect_of_well_typed_tot_or_gtot_term env tm ctx_u.ctx_uvar_typ (not env.phase1 && not env.lax))
                 in
                 let g' =
                   match discharge_guard' (Some (fun () ->
  
positive.code:                           BU.print1 "WP guard (simplifed) is (%s)\n" (Print.term_to_string (N.normalize [Env.Iota; Env.Eager_unfolding; Env.Primops; Env.Simplify] env g));
                        let base_prob, wl = sub_prob wl c1.result_typ problem.relation c2.result_typ "result type" in
                        let wl = solve_prob orig (Some <| U.mk_conj (p_guard base_prob) g) [] wl in
                        solve env (attempt [base_prob] wl)
      in
  
      if BU.physical_equality c1 c2
  
negative.code:                                     (rel_to_string problem.relation)
                                      (Print.comp_to_string c2) in
           let c1, c2 = N.ghost_to_pure env c1, N.ghost_to_pure env c2 in
           let univ_subprobs, wl_univs = [], wl in
             // let c1_univs, c2_univs =
             //   (U.comp_to_comp_typ_nouniv c1).comp_univs,
             //   (U.comp_to_comp_typ_nouniv c2).comp_univs in
             // if List.length c1_univs = List.length c2_univs
             // then
             //   List.fold_left2 (fun (univ_sub_probs, wl) u1 u2 ->
             //     let p, wl = sub_prob wl
             //       (S.mk (S.Tm_type u1) Range.dummyRange)
             //       EQ
             //       (S.mk (S.Tm_type u2) Range.dummyRange)
             //       "effect universes" in
             //     univ_sub_probs@[p], wl) ([], wl) c1_univs c2_univs
             // else [], wl in
           match c1.n, c2.n with
           | GTotal (t1, _), Total (t2, _) when (Env.non_informative env t2) ->
             let tprob = TProb (problem_using_guard orig t1 problem.relation t2 None "result type") in
             solve env (attempt (univ_subprobs@[tprob]) wl_univs)
  
           | GTotal _, Total _ ->
             giveup env (Thunk.mkv "incompatible monad ordering: GTot </: Tot")  orig
  
           | Total  (t1, _), Total  (t2, _)
           | GTotal (t1, _), GTotal (t2, _) -> //rigid-rigid 1
             let tprob = TProb (problem_using_guard orig t1 problem.relation t2 None "result type") in
             solve env (attempt (univ_subprobs@[tprob]) wl_univs)
  
           | Total  (t1, _), GTotal (t2, _) when problem.relation = SUB ->
             let tprob = TProb (problem_using_guard orig t1 problem.relation t2 None "result type") in
             solve env (attempt (univ_subprobs@[tprob]) wl_univs)
  
           | Total  (t1, _), GTotal (t2, _) ->
             giveup env (Thunk.mkv "GTot =/= Tot") orig
  
           | GTotal _, Comp _
           | Total _,  Comp _ ->
             solve_c env ({problem with lhs=mk_Comp <| Env.comp_to_comp_typ env c1}) wl
  
           | Comp _, GTotal _
           | Comp _, Total _ ->
             solve_c env ({problem with rhs=mk_Comp <| Env.comp_to_comp_typ env c2}) wl
  
           | Comp _, Comp _ ->
              if (U.is_ml_comp c1 && U.is_ml_comp c2)
              || (U.is_total_comp c1 && U.is_total_comp c2)
              || (U.is_total_comp c1 && U.is_ml_comp c2 && problem.relation=SUB)
              then
                let tprob = TProb (problem_using_guard orig (U.comp_result c1) problem.relation (U.comp_result c2) None "result type") in
                solve env (attempt (univ_subprobs@[tprob]) wl_univs)
              else let c1_comp = Env.comp_to_comp_typ env c1 in
                   let c2_comp = Env.comp_to_comp_typ env c2 in
                   if problem.relation=EQ
  