findOperator method
Implementation
InterpretedFunction? findOperator(String operatorSymbol) {
// Check instance operators in the current class and superclasses
InterpretedClass? currentClass = klass;
while (currentClass != null) {
final operator = currentClass.findOperator(operatorSymbol);
if (operator != null) {
return operator;
}
// Move up to the superclass
currentClass = currentClass.superclass;
}
// Check interpreted mixins (in reverse order for correct precedence)
for (int i = klass.mixins.length - 1; i >= 0; i--) {
final mixin = klass.mixins[i];
final operator = mixin.findOperator(operatorSymbol);
if (operator != null) {
return operator;
}
}
// No operator found
return null;
}