Closed sadphi closed 2 years ago
Good catch! Have you checked what the official api documentation says? And perhaps, if needed, also look at the implementation to check your assumptions and what to write in the quickref? (should be as short as possible and the proposed wordings eems fine if it aligns with doc/implementation)
I've taken a look at the official api docs here, and at the implementations that are linked there, and the behaviour matches the assumption. I've created a pull request (#640) with the proposed change.
Excellent! Many thanks!
Fixed by #640
There is an incorrect description for the methods
add
andremove
for mutable sets in the quickref, and can be found at page 7. The description currently says "Adds/removes x to xs and returns true if x was in xs, else false.", however this is only the case for the methodremove
. See the following REPL example (using Scala 3.1.3):The behaviour seems to be that the methods return
true
if the methods actually mutated the set. I suggest that the description is changed to "Adds/removes x to xs and returns true if xs was mutated, else false.", or something similar. I can create a pull request with this change if it sounds good.