     assert_raise CompileError, ~r"undefined field no_field on record :timestamp", fn ->
       test_module do
         require Record
-        Record.defrecord :timestamp, [date: 1, time: 2]
+        Record.defrecord(:timestamp, date: 1, time: 2)
         @type my_type :: record(:timestamp, no_field: :foo)
       end
     end


  defp callbacks(bytecode) do
    Kernel.Typespec.beam_callbacks(bytecode)
    |> Enum.sort
  end

  test "invalid type specification" do

  end

  test "@type with public record" do
    bytecode =
      test_module do
        require Record
        Record.defrecord(:timestamp, date: 1, time: 2)
        @type my_type :: record(:timestamp, time: :foo)
      end

    assert [type: {:my_type, type, []}] = types(bytecode)
    assert {:type, _, :tuple, [timestamp, term, foo]} = type
    assert {:atom, 0, :timestamp} = timestamp
    assert {:type, 0, :term, []} = term
    assert {:atom, 0, :foo} = foo
  end

  test "@type with private record" do
    bytecode =
      test_module do
        require Record
        Record.defrecordp(:timestamp, date: 1, time: 2)
        @type my_type :: record(:timestamp, time: :foo)
      end

    assert [type: {:my_type, type, []}] = types(bytecode)
    assert {:type, _, :tuple, args} = type
    assert [{:atom, 0, :timestamp}, {:type, 0, :term, []}, {:atom, 0, :foo}] = args
  end

  test "@type with undefined record" do
