Example below shows how one can have arbitrary module overwrite without resolving to calling disallowed functions:
test "rewrite MiniEixir" do
code = """
defmodule Foo do
defmodule :"Elixir.MiniElixir" do
def eval(_, _, _, _), do: :pwnd
end
def bar(a) do
a
end
end
"""
assert {:ok, _} = MiniElixir.eval(code, Foo, :bar, [2137])
assert :pwnd = MiniElixir.eval(code, Foo, :bar, [2137])
end
This will also silence any error that is happening, because of compiler options being set.
Example below shows how one can have arbitrary module overwrite without resolving to calling disallowed functions:
This will also silence any error that is happening, because of compiler options being set.