fix #4751, type inference and performance of special tuple reductions