I've recently looked at how the '==' operator works with classes. I was disappointed to find that 'a == b' always gets rewritten to:

.object.opEquals(a, b);

The reason for my disappointment is that this results in unnecessary overhead. I would think that the compiler would first try to rewrite the '==' operator using a type-specific opEquals method, then fall back on the generic version if one did not exist. Is there a reason for this?

Reply via email to