anchor.diff:                  env, Inl xx, S.mk_binder xx::rec_bindings 
                 | Inr l ->
                   push_top_level_rec_binding env l.ident S.Delta_equational, Inr l, rec_bindings in
  -            env, (lbname::fnames), rec_bindings) (env, [], []) funs in
  -
  +            env, (lbname::fnames), rec_bindings) (env, [], []) funs
  +        in
           let fnames = List.rev fnames in
   
           let desugar_one_def env lbname ((_, args, result_t), def) =
  -            let def = match result_t with
  -                | None -> def
  -                | Some t -> mk_term (Ascribed(def, t)) (Range.union_ranges t.range def.range) Expr in
  +            let args = args |> List.map replace_unit_pattern in
  +            let def = 
  +              match result_t with
  +              | None -> def
  +              | Some t -> 
  +                if is_comp_type env t
  +                then begin match args |> List.tryFind (fun x -> not (is_var_pattern x)) with
  +                     | None -> ()
  +                     | Some p -> 
  +                        raise (Error ("Computation type annotations are only permitted on let-bindings without inlined patterns; replace this pattern with a variable", p.prange))
  +                end;
  +                mk_term (Ascribed(def, t)) (Range.union_ranges t.range def.range) Expr in
               let def = match args with 
                    | [] -> def 
                    | _ -> mk_term (un_curry_abs args def) top.range top.level in 
  
positive.code: 
      | _ ->
        error "Unexpected term" top top.range
    end
  
  and desugar_args env args = 
  
negative.code:                                   then (Inr (qualify env id), [], None), def
                                    else (Inl id, [], None), def
                                  | _ -> raise (Error("Unexpected let binding", p.prange))
                        end) 
          in
  
          //Generate fresh names and populate an env' with recursive bindings
          //below, we use env' instead of env, only if is_rec
          let env', fnames, rec_bindings =
            List.fold_left (fun (env, fnames, rec_bindings) ((f, _, _), _) ->
              let env, lbname, rec_bindings = match f with
  