Rename ToString to mention Operator (#2539)

Naming this ToString within the Carbon namespace encourages incidental overloading of the function, and that doesn't seem to be intentional; this feels questionable [under overloading style](https://google.github.io/styleguide/cppguide.html#Function_Overloading). OperatorToString seems helpful in that it makes it easy to see at a glance where it's being used.
This commit is contained in:
Jon Ross-Perkins
2023-01-20 11:32:37 -08:00
committed by GitHub
parent 09ac000305
commit 421883ec8f
5 changed files with 13 additions and 12 deletions
+1 -1
View File
@@ -253,7 +253,7 @@ auto Interpreter::EvalPrim(Operator op, Nonnull<const Value*> /*static_type*/,
case Operator::BitShiftLeft:
case Operator::BitShiftRight:
case Operator::Complement:
CARBON_FATAL() << "operator " << ToString(op)
CARBON_FATAL() << "operator " << OperatorToString(op)
<< " should always be rewritten";
}
}