Skip to content

Commit 3f4410f

Browse files
committed
Make sure IEx r helper does not return a record
The tuple r/1 returns can be a record and IEx will try to inspect it. Tag the tuple so it will be inspected as a tuple.
1 parent 349873a commit 3f4410f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/iex/lib/iex/helpers.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ defmodule IEx.Helpers do
302302
"""
303303
def r(module) when is_atom(module) do
304304
case do_r(module) do
305-
mods when is_list(mods) -> { module, mods }
305+
mods when is_list(mods) -> { :reloaded, module, mods }
306306
other -> other
307307
end
308308
end

lib/iex/test/iex/helpers_test.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ defmodule IEx.HelpersTest do
322322
assert Sample.run == :run
323323

324324
File.write! filename, "defmodule Sample do end"
325-
assert {Sample, [Sample]} = r(Sample)
325+
assert { :reloaded, Sample, [Sample] } = r(Sample)
326326
assert_raise UndefinedFunctionError, "undefined function: Sample.run/0", fn ->
327327
Sample.run
328328
end
@@ -346,7 +346,7 @@ defmodule IEx.HelpersTest do
346346
assert :sample.hello == :world
347347

348348
File.write!(filename, other_erlang_module_code)
349-
assert { :sample, [:sample] } = r(:sample)
349+
assert { :reloaded, :sample, [:sample] } = r(:sample)
350350
assert :sample.hello == :bye
351351
end
352352
after

0 commit comments

Comments
 (0)