Skip to content

Instantly share code, notes, and snippets.

@mattfreer
Last active October 12, 2015 07:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattfreer/2986652803ec83704564 to your computer and use it in GitHub Desktop.
Save mattfreer/2986652803ec83704564 to your computer and use it in GitHub Desktop.
Since upgrading to Elixir 1.1 and Eralang 18, I'm noticing that Dialyzer has some issues with String interpolation. This Gist demonstrates an issue with EEx templates that map over a list of Strings
<%= Enum.map arbitrary_list, fn(item) -> %>
<%= item %>
<%= end %>
bad_template.eex:5: Guard test is_binary(_@2::[any()]) can never succeed
defmodule Scaffold do
require EEx
EEx.function_from_file(
:def,
:bad_template,
Path.expand("bad_template.eex", "lib/templates"),
[:arbitrary_list]
)
def build do
template = bad_template(["foo", "bar"])
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment