-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
Labels
Milestone
Description
As I described on elixir-lang-core, I had a bug that happened because my eyes slipped over the following bug:
<% if @password do %>
Temporary password: <%= @password %>
<% else %>
You will need to log in with your password.
<% end %>
The error is easily corrected:
<%= if @password do %>
Temporary password: <%= @password %>
<% else %>
You will need to log in with your password.
<% end %>
It seems to me that the EEx compiler should be able to provide a compile warning if a block is used when <% … %>
is used instead of <%= … %>
.
This would introduce one possible incompatibility with the current compiler:
<% somevar = for item <- list do %>
<% if(item % 2 == 0, do: item * 2, else: item * 3) %>
<% end %>
This can be resolved by combining these into a single tag:
<% somevar = form item <- list do
if(item % 2 == 0, do: item * 2, else: item * 3)
end %>
As requested, I’ve opened an issue.
v0idpwn and lwldlwld