type inference bug