You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 3, 2025. It is now read-only.
When one operand is an ordinary Object and the other is an Object with overloaded operators, the ordinary object is first coerced to some kind of primitive, making it less useful unless both operands were set up for overloading.
Is this restriction really necessary? It prevents any overloads on special-purpose classes working with ordinary objects.
Some examples:
withoperatorsfromSet;set&newSet([2,3,5]);// possible ... set intersectionset&[2,3,5];// impossible ... non-primitiveset&map.keys();// impossible ... non-primitivewithoperatorsfromFunction;42|foo;// possible ... foo(42)obj|foo;// impossiblewithoperatorsfromMySerializer;mySerializer<<42;// possible ... mySerialier.write(42)mySerializer<<obj;// impossible ... non-primitive