Added check that number of patterns in function declaration matches number expected based on type signature; added a failure test for this check