Dereference variable in match statement