Skip to content

Fix factory prop with single key#17

Open
thetamind wants to merge 3 commits intoblunt-elixir:reorgfrom
thetamind:fix-prop-single-key
Open

Fix factory prop with single key#17
thetamind wants to merge 3 commits intoblunt-elixir:reorgfrom
thetamind:fix-prop-single-key

Conversation

@thetamind
Copy link

Fixes FunctionClauseError when prop used with path with a single key.

Dialyzer correctly emitted a warning:

The call 'Elixir.Kernel':get_in
         (_acc@1 :: any(),
          fun(('get' | 'get_and_update', map(), fun((_) -> any())) ->
                  'pop' | [{atom(), _}] | {_, [{_, _}] | map()} | map())) will never return since the success typing is 
         (any(),
          nonempty_maybe_improper_list()) -> 
          any() and the contract is 
          ('Elixir.Access':t(), [term(), ...]) -> term()

Plus a couple other test fixups.

@thetamind thetamind changed the title fix factory prop with single key Fix factory prop with single key Apr 18, 2023
@trbngr
Copy link
Contributor

trbngr commented Apr 18, 2023

Fantastic. I've been bitten by this many times. Could never find the time to get in there!

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