Sorry about the object: macro have not meaning in this post.

On Thursday, July 14, 2016 at 4:44:36 PM UTC+2, Fiorillo Nicola wrote:
>
> 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/34496f19-112b-4fcb-9f47-95d8246f6384%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to