Pattern matching on typed parameters using reflection