Inference bug when using nested generators?

If you supply the init keyword to sum, inference works. To me this suggests the problem is that sum is not able to infer which type it should use for initialization.