Skip to content

Instantly share code, notes, and snippets.

@mattfreer mattfreer/bad_template.eex
Last active Oct 12, 2015

Embed
What would you like to do?
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
You can’t perform that action at this time.