 
     assert [type: {:kw, {:remote_type, _, [{:atom, _, Keyword}, {:atom, _, :t}, []]}, _},
             type: {:kw, {:remote_type, _, [{:atom, _, Keyword}, {:atom, _, :t}, [{:var, _, :value}]]}, [{:var, _, :value}]}] =
-      types(module)
+           types(bytecode)
   end
 
   test "invalid remote @type with module attribute that does not evaluate to a module" do

             {:type, _, :map, [
               {:type, _, :map_field_exact, [{:atom, _, :hello}, {:atom, _, :world}]}
             ]},
            []}] = types(module)
  end

  test "@type with a map" do
    module = test_module do
      @type my_type :: %{required(:a) => :b, optional(:c) => :d}
    end


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

  test "@type with undefined record" do
    assert_raise CompileError, ~r"unknown record :this_record_does_not_exist", fn ->
      test_module do
        @type my_type :: record(:this_record_does_not_exist, [])
      end
    end
  end
