Created
January 5, 2015 21:29
-
-
Save jonnystorm/5fb5aa7a543313e0af38 to your computer and use it in GitHub Desktop.
Demonstrate surprising Dialyzer warning for list comprehension
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 Demo do | |
def test1a, do: [1] | |
def test1b(x) do | |
# demo.ex:6: The created fun has no local return | |
for e <- test1a, do: x | |
end | |
def test2a, do: 1 | |
def test2b(x) do | |
for e <- [test2a], do: x | |
end | |
def test3a, do: [1] | |
def test3b(x) do | |
for e <- test3a, do: 1 | |
end | |
def test4a, do: [1] | |
def test4b do | |
for e <- test4a, do: e | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment