Skip to content

Instantly share code, notes, and snippets.

@zambal
Created April 17, 2015 16:54
Show Gist options
  • Save zambal/52ab241a8c84a80e9e13 to your computer and use it in GitHub Desktop.
Save zambal/52ab241a8c84a80e9e13 to your computer and use it in GitHub Desktop.
False unused import warning
defmodule ToImport do
def hello do
"Hello"
end
end
defmodule Test do
import ToImport
defmacrop precompile(expr) do
{ res, _ } = Code.eval_quoted(expr, [], __CALLER__)
quote do
unquote(res)
end
end
def test do
precompile hello()
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment