       @doc "Function doc"
       assert @doc == "Function doc"
       assert Module.get_attribute(__MODULE__, :doc) == {__ENV__.line - 2, "Function doc"}
+
       def foobar() do
         :ok
       end

      assert Code.get_docs(SampleDocs, :type_docs) == docs[:type_docs]
      assert Code.get_docs(SampleDocs, :callback_docs) == docs[:callback_docs]

      assert [{{:bar, 1}, _, :def, [{:bool, _, Elixir}], false},
              {{:foo, 1}, _, :def, [{:arg, _, nil}], "Function doc"}] = docs[:docs]

      assert {_, "Module doc"} = docs[:moduledoc]

      assert [{{:bar, 1}, _, :opaque, "Opaque type doc"},
              {{:foo, 1}, _, :type, "Type doc"}] = docs[:type_docs]

      assert [{{:bar, 0}, _, :callback, false},
              {{:baz, 2}, _, :callback, nil},
              {{:foo, 1}, _, :callback, "Callback doc"},
              {{:qux, 1}, _, :macrocallback, "Macrocallback doc"}] = docs[:callback_docs]
    end
  end
end

  test "compiled without docs" do
    Code.compiler_options(docs: false)

    write_beam(
      defmodule WithoutDocs do
        @moduledoc "Module doc"

        @doc "Some doc"
        def foobar(arg), do: arg
      end
    )

    assert Code.get_docs(WithoutDocs, :docs) == nil
    assert Code.get_docs(WithoutDocs, :moduledoc) == nil
