I found it out: If the case statement is followed by a variable (i.e. not a static value), it is interpreted as a field into which the value is assigned, not as a value to check against. Doh.