do not cancel pattern matching if matched enum is empty (closes #2233)