typing error in getInfillOptFunction