added test case and further refinement of matching to support types with
params.