Hi all,
I have a elixir/phoenix project in production written in 1.2.x elixir 
version.
I'm migrating to 1.3.1 and some "unsafe variable" warning appear: most of 
them were real and useful but I cannot understand the following situation:

#!/usr/bin/env elixir
list = [:one]

if false do
  list = [:two | list]
end

IO.inspect list    # warning occurs

If, as warning comment suggests, I write

#!/usr/bin/env elixir
list = [:one]

*list =*
*  if false do*
*    list = [:two | list]*
*  end*

IO.inspect list

# here list is nil

list variable assumes an incorrect value.

Question is: why elixir compiler assume that block must return a value?

Thanks,
Nicola


-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-talk/5bb3de3c-5cc4-499b-a02d-64f6bfa7fe21%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to