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

Remove not used code #6064

Merged
merged 1 commit into from
Jan 26, 2025
Merged

Conversation

lukaszsamson
Copy link
Contributor

Found by 1.19 typesystem. The build_params() call returns a non empty list so merge_all = merge_params ++ merge_private ++ merge_assigns is non empty as well.

     warning: comparison between distinct types found:

         merge_all != []

     given types:

         dynamic(non_empty_list(term(), term())) != empty_list()

     where "merge_all" was given the type:

         # type: dynamic(non_empty_list(term(), term()))
         # from: lib/phoenix/router/route.ex:178:15
         merge_all = merge_params ++ merge_private ++ merge_assigns

     While Elixir can compare across all types, you are comparing across types which are always disjoint, and the result is either always true or always false

     typing violation found at:
     │
 180 │     if merge_all != [] do
     │                  ~
     │
     └─ lib/phoenix/router/route.ex:180:18: Phoenix.Router.Route.build_prepare/1

@SteffenDE SteffenDE merged commit 1934500 into phoenixframework:main Jan 26, 2025
4 of 5 checks passed
@SteffenDE
Copy link
Contributor

Thank you! 🙌🏻

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