This is another bug that I discovered after deploying CASE/IN expressions internally.
The current implementation of CASE/IN expression assumes that the 1st operand is a single expression. But this is not true, for example, if it contains a dereferencing operator. The following example demonstrates the problem:
This fails with the following error:
Here is the relavant code that causes trouble: