Lunch and Learn: Designing Overloaded and Custom Operators
summary
Argues that operator overloading must be reserved for well defined mathematical operations (string concatenation, dot product, matrix multiply) and that Swift requires declaring operator precedence and associativity for each operator. Warns that custom operators are possible (including many Unicode symbols) but are hard to discover and can break tooling; equality overloads must respect Equatable/Hashable invariants; warns that one can redefine existing operator meanings globally in Swift, which is legal but dangerously confusing.
AI-written summary · about
