fix bug in type arg inference for recursive generic function calls
found by John Vasileff