Subject: | Nested set(set(), ...) ignores the first argument |
If the first argument to Set::Object's set() function is itself the result of a set() call, it is silently ignored:
use Set::Object qw(set);
say set( set() )->size; # prints 0 (should print 1)
say set( set(), "foo" )->size; # prints 1 (should print 2)
say set( set(), set() )->size; # prints 1 (should print 2)
say set( "foo", set() )->size; # prints 2, as it should
say set( set(2, 4, 6), "foo" )->size; # prints 1 (should print 2)
say set( "foo", set(2, 4, 6) )->size; # prints 2, as it should
This is rather unexpected and makes it difficult to work with sets of sets.