Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix inputs_form spec #296

Merged

Conversation

lukaszsamson
Copy link
Contributor

v2.14.11 introduced a regression. Now a valid code

<%= inputs_for f, :my_field, fn f2 -> %>
    <div class="form-group">
      <%= label f2, :name, class: "control-label" %>
      <%= text_input f2, :name, class: "form-control" %>
      <%= error_tag f2, :name %>
    </div>
<% end %>

fails to dialyze with

The function call will not succeed.

Phoenix.HTML.Form.inputs_for(_f :: any(), :my_field, (_ -> {:safe, [any(), ...]}))

breaks the contract
(t(), field(), Keyword.t()) :: [t()]

@josevalim josevalim merged commit 004bc46 into phoenixframework:master Mar 23, 2020
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants