Repository navigation
Fix two compile warnings under Elixir 1.20 - #143
Open
themiguelamador wants to merge 1 commit into
Open
themiguelamador wants to merge 1 commit into
themiguelamador wants to merge 1 commit into
Conversation
- Remove the unused `require PolymorphicEmbed.OptionsValidator`: the module is only called through its alias (`OptionsValidator.validate!/1`), never as a macro. - Drop the `\\ nil` default on `polymorphic_embed_inputs_for/4`. The default generates a 3-arity head that is unreachable, because an explicit `polymorphic_embed_inputs_for(form, field, fun)` clause already exists; Elixir 1.20's type checker reports it as "incompatible types given as default arguments". No behaviour change: 3-arity calls already resolve to that clause.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two compile warnings appear with Elixir 1.20's type checker (5.0.6 and current
master):lib/polymorphic_embed.ex: therequireis unused, becauseOptionsValidatoris only called through its alias. Removed.lib/polymorphic_embed/html/form.ex:polymorphic_embed_inputs_for(form, field, type \\ nil, fun)'s default generates a 3-arity head that can never be reached. An explicitpolymorphic_embed_inputs_for(form, field, fun)clause is defined just above it. Removed the default.No behaviour change: 3-arity calls already resolve to the explicit clause.
Verified on Elixir 1.20.3 / OTP 28: both warnings are gone after
mix compile --force, andmix testpasses (77 tests).