anchor.diff:                      fmt("~!Wbreaks the contract~!! ~s\n", [good_arg(ArgNs, Contract)]);
                   false ->
                       fmt("~!Wbreaks the contract~!! ~s ~!Win the~!!"
  -                           " ~s ~!Wargument\n",
  +                        " ~s ~!Wargument\n",
                           [good_arg(ArgNs, Contract), PositionString])
               end;
           both ->
               fmt("~!Wwill never return since the success typing is "
  -                   "~!!~s ~!W->~!! ~s ~!Wand the contract is ~!!~s\n",
  -                   [good_arg(ArgNs, SigArgs), SigRet,
  -                    good_arg(ArgNs, Contract)])
  +                "~!!~s ~!W->~!! ~s ~!Wand the contract is ~!!~s\n",
  +                [good_arg(ArgNs, SigArgs), SigRet,
  +                 good_arg(ArgNs, Contract)])
       end.
   
   form_positions(ArgNs) ->
  
positive.code:     end;
  message_to_string({record_constr, [RecConstr, FieldDiffs]}) ->
      fmt("~!WRecord construction ~!!~s~!W violates the"
             " declared type of field ~!!~s\n", [RecConstr, FieldDiffs]);
  message_to_string({record_constr, [Name, Field, Type]}) ->
      fmt("~!WRecord construction violates the declared type for ~!!#~w{}~!W"
             " since ~!!~s~!W cannot be of type ~!!~s\n",
             [Name, Field, Type]);
  message_to_string({record_matching, [String, Name]}) ->
      fmt("~!WThe ~!!~s~!W violates the"
             " declared type for ~!!#~w{}\n", [String, Name]);
  message_to_string({record_match, [Pat, Type]}) ->
      fmt("~!WMatching of ~!!~s~!W tagged with a record name violates the"
             " declared type of ~!!~s\n", [Pat, Type]);
  message_to_string({pattern_match, [Pat, Type]}) ->
      fmt("~!WThe ~s~!W can never match the type ~!g~s\n",
             [bad_pat(Pat), Type]);
  message_to_string({pattern_match_cov, [Pat, Type]}) ->
      fmt("~!WThe ~s~!W can never match since previous"
             " clauses completely covered the type ~!g~s\n",
             [bad_pat(Pat), Type]);
  message_to_string({unmatched_return, [Type]}) ->
      fmt("~!WExpression produces a value of type ~!!~s~!W,"
             " but this value is unmatched\n", [Type]);
  message_to_string({unused_fun, [F, A]}) ->
      fmt("~!WFunction ~!r~w/~w~!W will never be called\n", [F, A]);
  %%----- Warnings for specs and contracts -------------------
  message_to_string({contract_diff, [M, F, _A, Contract, Sig]}) ->
      fmt("~!WType specification ~!!~w:~w~s~!W"
             " is not equal to the success typing: ~!!~w:~w~s\n",
             [M, F, Contract, M, F, Sig]);
  message_to_string({contract_subtype, [M, F, _A, Contract, Sig]}) ->
      fmt("~!WType specification ~!!~w:~w~s~!W"
             " is a subtype of the success typing: ~!!~w:~w~s\n",
             [M, F, Contract, M, F, Sig]);
  message_to_string({contract_supertype, [M, F, _A, Contract, Sig]}) ->
      fmt("~!WType specification ~!!~w:~w~s~!W"
             " is a supertype of the success typing: ~!!~w:~w~s\n",
             [M, F, Contract, M, F, Sig]);
  message_to_string({contract_range, [Contract, M, F, ArgStrings, Line, CRet]}) ->
      fmt("~!WThe contract ~!!~w:~w~s~!W cannot be right because the"
             " inferred return for ~!!~w~s~!W on line ~!!~w~!W is ~!!~s\n",
             [M, F, Contract, F, ArgStrings, Line, CRet]);
  message_to_string({invalid_contract, [M, F, A, Sig]}) ->
      fmt("~!WInvalid type specification for function~!! ~w:~w/~w."
             "~!W The success typing is~!! ~s\n", [M, F, A, Sig]);
  message_to_string({extra_range, [M, F, A, ExtraRanges, SigRange]}) ->
      fmt("~!WThe specification for ~!!~w:~w/~w~!W states that the function"
             " might also return ~!!~s~!W but the inferred return is ~!!~s\n",
             [M, F, A, ExtraRanges, SigRange]);
  message_to_string({overlapping_contract, [M, F, A]}) ->
      fmt("~!WOverloaded contract for ~!!~w:~w/~w~!W has overlapping"
             " domains; such contracts are currently unsupported and are simply "
             "ignored\n", [M, F, A]);
  message_to_string({spec_missing_fun, [M, F, A]}) ->
      fmt("~!WContract for function that does not exist: ~!!~w:~w/~w\n",
             [M, F, A]);
  %%----- Warnings for opaque type violations -------------------
  message_to_string({call_with_opaque, [M, F, Args, ArgNs, ExpArgs]}) ->
      fmt("~!WThe call ~!!~w:~w~s~!W contains ~!!~s~!W when ~!!~s\n",
             [M, F, Args, form_positions(ArgNs), form_expected(ExpArgs)]);
  message_to_string({call_without_opaque, [M, F, Args, [{N,_,_}|_] = ExpectedTriples]}) ->
      fmt("~!WThe call ~!!~w:~w~s ~!Wdoes not have~!! ~s\n",
          [M, F, bad_arg(N, Args), form_expected_without_opaque(ExpectedTriples)]);
  message_to_string({opaque_eq, [Type, _Op, OpaqueType]}) ->
      fmt("~!WAttempt to test for equality between a term of type ~!!~s~!W"
             " and a term of opaque type ~!!~s\n", [Type, OpaqueType]);
  message_to_string({opaque_guard, [Arg1, Infix, Arg2, ArgNs]}) ->
      fmt("~!WGuard test ~!!~s ~s ~s~!W contains ~!!~s\n",
             [Arg1, Infix, Arg2, form_positions(ArgNs)]);
  message_to_string({opaque_guard, [Guard, Args]}) ->
      fmt("~!WGuard test ~!!~w~s~!W breaks the opaqueness of its"
             " argument\n", [Guard, Args]);
  message_to_string({opaque_match, [Pat, OpaqueType, OpaqueTerm]}) ->
      Term = if OpaqueType =:= OpaqueTerm -> "the term";
                true -> OpaqueTerm
             end,
      fmt("~!WThe attempt to match a term of type ~!!~s~!W against the"
             "~!! ~s~!W breaks the opaqueness of ~!!~s\n",
             [OpaqueType, Pat, Term]);
  message_to_string({opaque_neq, [Type, _Op, OpaqueType]}) ->
      fmt("~!WAttempt to test for inequality between a term of type ~!!~s"
             "~!W and a term of opaque type ~!!~s\n", [Type, OpaqueType]);
  message_to_string({opaque_type_test, [Fun, Args, Arg, ArgType]}) ->
      fmt("~!WThe type test ~!!~s~s~!W breaks the opaqueness of the term "
             "~!!~s~s\n", [Fun, Args, Arg, ArgType]);
  message_to_string({opaque_size, [SizeType, Size]}) ->
      fmt("~!WThe size ~!!~s~!W breaks the opaqueness of ~!!~s\n",
             [SizeType, Size]);
  message_to_string({opaque_call, [M, F, Args, Culprit, OpaqueType]}) ->
      fmt("~!WThe call ~!!~s:~s~s~!W breaks the opaqueness of the term~!!"
             " ~s :: ~s\n", [M, F, Args, Culprit, OpaqueType]);
  %%----- Warnings for concurrency errors --------------------
  message_to_string({race_condition, [M, F, Args, Reason]}) ->
      fmt("~!WThe call ~!!~w:~w~s ~s\n", [M, F, Args, Reason]);
  %%----- Warnings for behaviour errors --------------------
  message_to_string({callback_type_mismatch, [B, F, A, ST, CT]}) ->
      fmt("~!WThe inferred return type of~!! ~w/~w (~s) ~!W"
             "has nothing in common with~!! ~s, ~!Wwhich is the expected"
             " return type for the callback of~!! ~w ~!Wbehaviour\n",
             [F, A, ST, CT, B]);
  message_to_string({callback_arg_type_mismatch, [B, F, A, N, ST, CT]}) ->
      fmt("~!WThe inferred type for the~!! ~s ~!Wargument of~!!"
             " ~w/~w (~s) ~!Wis not a supertype of~!! ~s~!W, which is"
             "expected type for this argument in the callback of the~!! ~w "
             "~!Wbehaviour\n",
             [ordinal(N), F, A, ST, CT, B]);
  message_to_string({callback_spec_type_mismatch, [B, F, A, ST, CT]}) ->
      fmt("~!WThe return type ~!!~s~!W in the specification of ~!!"
             "~w/~w~!W is not a subtype of ~!!~s~!W, which is the expected"
             " return type for the callback of ~!!~w~!W behaviour\n",
             [ST, F, A, CT, B]);
  message_to_string({callback_spec_arg_type_mismatch, [B, F, A, N, ST, CT]}) ->
      fmt("~!WThe specified type for the ~!!~s~!W argument of ~!!"
             "~w/~w (~s)~!W is not a supertype of ~!!~s~!W, which is"
             " expected type for this argument in the callback of the ~!!~w"
             "~!W behaviour\n", [ordinal(N), F, A, ST, CT, B]);
  message_to_string({callback_missing, [B, F, A]}) ->
      fmt("~!WUndefined callback function ~!!~w/~w~!W (behaviour ~!!"
             "'~w'~!W)\n",[F, A, B]);
  message_to_string({callback_info_missing, [B]}) ->
      fmt("~!WCallback info about the ~!r~w~!W"
             " behaviour is not available\n", [B]);
  %%----- Warnings for unknown functions, types, and behaviours -------------
  message_to_string({unknown_type, {M, F, A}}) ->
      fmt("~!WUnknown type ~!r~w:~w/~w", [M, F, A]);
  
negative.code:     Str = try
                format_warning(Warning, fullpath)
            catch
                Error:Reason ->
                    ?DEBUG("Failed to pretty format warning: ~p:~p",
                           [Error, Reason]),
                    dialyzer:format_warning(Warning, fullpath)
            end,
      case strip(Str) of
  