Type inference for “next”