Skip to content

Set should not understand the , message #19405

@jordanmontt

Description

@jordanmontt

The , message is typically used to concatenate ordered collections such as arrays or strings. Its expected behavior is to return a sequential, ordered concatenation of the receiver and the argument.

However, a Set does not preserve order by definition. Because of this, supporting the , message on Set introduces semantic inconsistency: the operation suggests ordered concatenation, while sets are unordered collections.

Proposed change

The Set class should not implement or respond to the , message. Users should call the union: method explicitly.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions