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
Set#to_a&
works the same as to_a
#14518
Comments
Hum, the implementation is indeed wrong, as it never calls the block, but the documentation may still be correct about the intent of filtering duplicates 😕 I tried looking at Ruby, but there's no |
An alternative is to deprecate Set{1, 2, 3, 4, 5}.map { |i| i // 2 } # => [0, 1, 1, 2, 2] Unless we want |
It is meant to override |
The current setup of
Set#to_a&
has the following example in the docs:# Set{1, 2, 3, 4, 5}.to_a { |i| i // 2 } # => [0, 1, 2]
, which doesn't seem about right since there should be 5 elements present, as well as looking at the method so doesn't it actually do anything with the accepted block:Link to the method in code:
crystal/src/set.cr
Line 390 in 096f89b
The text was updated successfully, but these errors were encountered: