I see this comment which meaning is different from the code.
Maybe this is the problem.
But actually it's better to cast concrete expressions to enum type, like this:
Instead of this:
Need to change GetBinaryExpressionType()so that it reutrns the enum type for String and enum operands.
Let’s keep just open.