Fix issue with recursive dependency in inference with generators