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

Elixir 1.18 compatibility #333

Merged
merged 1 commit into from
Oct 18, 2024

Conversation

maennchen
Copy link
Contributor

When using excoveralls with elixir main, the following error is produced:

     ** (Protocol.UndefinedError) protocol Enumerable not implemented for {"defmodule Test do", nil} of type Tuple. This protocol is implemented for the following type(s): Date.Range, File.Stream, Function, GenEvent.Stream, HashDict, HashSet, IO.Stream, List, Map, MapSet, Range, Stream

This is because we provide a list of tuples, but that is not valid according to the typespec @spec zip([list()]) :: [tuple()].

Since Elixir is deprecating List.zip/1, the code was slightly changed and a list of tuples is no longer accepted.

This PR switches to Enum.zip/1, and uses a list of lists instead of tuples. That should be compatible since Elixir 1.4 and avoid upcoming deprecations.

@maennchen
Copy link
Contributor Author

I've reported the issue upstream and the change that leads to the error has been reverted: elixir-lang/elixir@c60b477

It's however still not complying with the spec and using a deprecated function. Therefore the PR is still relevant.

@parroty parroty merged commit f8dc51d into parroty:master Oct 18, 2024
@parroty
Copy link
Owner

parroty commented Oct 18, 2024

Thank you!

@maennchen maennchen deleted the elixir_1.18_compatibility branch October 18, 2024 06:01
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