add a testcase for inferring types for recursive functions