     module = test_module do
       require Record
       Record.defrecordp :timestamp, [date: 1, time: 2]
-      @type mytype :: record(:timestamp, time: :foo)
-    end
-
-    assert [type: {:mytype,
+      @type my_type :: record(:timestamp, time: :foo)
+    end
+
+    assert [type: {:my_type,
              {:type, _, :tuple, [
                {:atom, 0, :timestamp}, {:type, 0, :term, []}, {:atom, 0, :foo}
              ]},

  test "@type unquote fragment" do
    module = test_module do
      quoted = quote unquote: false do
        name = :mytype
        type = :atom
        @type unquote(name)() :: unquote(type)
      end
      Module.eval_quoted(__MODULE__, quoted) |> elem(0)
    end

    assert [type: {:mytype, {:atom, _, :atom}, []}] =
           types(module)
  end



  test "@type with a remote type" do
    module = test_module do
      @type my_type :: Remote.Some.type
      @type my_type_arg :: Remote.type(integer)
    end

    assert [type: {:my_type, {:remote_type, _, [{:atom, _, Remote.Some}, {:atom, _, :type}, []]}, []},
            type: {:my_type_arg, {:remote_type, _, [{:atom, _, Remote}, {:atom, _, :type}, [{:type, _, :integer, []}]]}, []}] =
           types(module)
  end

