anchor.diff:      _ -> true
     end.
   
  -docs_chunk(Set, Line, Def, Defmacro, Types, Callbacks) ->
  +docs_chunk(Set, Module, Line, Def, Defmacro, Types, Callbacks) ->
     case elixir_compiler:get_opt(docs) of
       true ->
         {ModuleDocLine, ModuleDoc} = get_moduledoc(Line, Set),
  -      FunctionDocs = get_docs(Set, Def, function),
  -      MacroDocs = get_docs(Set, Defmacro, macro),
  +      FunctionDocs = get_docs(Set, Module, Def, function),
  +      MacroDocs = get_docs(Set, Module, Defmacro, macro),
         CallbackDocs = get_callback_docs(Set, Callbacks),
         TypeDocs = get_type_docs(Set, Types),
   
  
positive.code:    } || {Kind, {Name, Arity}, _, _, true} <- Types,
          {Key, Line, Doc} <- ets:lookup(Set, {type, Name, Arity})].
  
  signature_to_binary(Name, Signature) ->
    BinaryName = atom_to_binary(Name, utf8),
    Args = lists:map(fun
      FormatArg({'\\\\', _, [Left, Right]}) ->
        [FormatArg(Left), " \\\\ ", 'Elixir.Macro':to_string(Right)];
      FormatArg({Var, _, _}) ->
        atom_to_binary(Var, utf8)
    end, Signature),
    iolist_to_binary([BinaryName, "(", lists:join(", ", Args), ")"]).
  
  doc_metadata(opaque) -> #{opaque => true};
  doc_metadata(_)      -> #{}.
  
negative.code:     {DocLine, Doc} -> {DocLine, doc_value(Doc)}
    end.
  
  get_docs(Set, Module, Definitions, Kind) ->
    [{Key,
      erl_anno:new(Line),
      [signature_to_binary(Module, Name, Signature)],
      doc_value(Doc),
      doc_metadata(Kind)
     } || {Name, Arity} <- Definitions,
  