Automatically set the value type for the case statement