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

Doesn't work with Array #279

Open
tschuchortdev opened this issue Dec 3, 2024 · 2 comments
Open

Doesn't work with Array #279

tschuchortdev opened this issue Dec 3, 2024 · 2 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@tschuchortdev
Copy link

tschuchortdev commented Dec 3, 2024

It appears that none of the collection constraints work with Array. I think this is an oversight: the constraints are defined in terms of Iterable but it turns out that Array is not Iterable for some reason. Solution: another specialized class has to be defined for Array, similar to that for String.

Library version: 2.6.0
Scala version: 3.5.2

@tschuchortdev tschuchortdev added the bug Something isn't working label Dec 3, 2024
@Iltotore Iltotore added the good first issue Good for newcomers label Dec 4, 2024
@Iltotore
Copy link
Owner

Iltotore commented Dec 4, 2024

It is intented that Array is not an Iterable since it is a Java/JVM object rather something native from Scala. There is instead an implicit conversion to Iterable, just like String.

Solution: another specialized class has to be defined for Array, similar to that for String.

This is the way. I'm currently too busy atm to do it so if anyone wants to tackle it, they are welcome!

@orangepigment
Copy link
Contributor

so if anyone wants to tackle it, they are welcome!

I will do it.

Iltotore pushed a commit that referenced this issue Dec 13, 2024
Part of #279 

I have added support of Length and Contain constraints for Arrays and
update the docs of these constraints.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants