Last active
October 12, 2015 07:48
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= Enum.map arbitrary_list, fn(item) -> %> | |
<%= item %> | |
<%= end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bad_template.eex:5: Guard test is_binary(_@2::[any()]) can never succeed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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