# Inference bug when using nested generators?

**URL:** https://discourse.julialang.org/t/inference-bug-when-using-nested-generators/82991
**Category:** General Usage
**Created:** [June 19, 2022, 12:51am UTC](https://discourse.julialang.org/t/inference-bug-when-using-nested-generators/82991 "2022-06-19T00:51:28Z")
**Posts on this page:** 1
**Showing post:** 7

<div class="post-metadata">

### Author: ![jakobnissen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jakobnissen/32/13477_2.png) [@jakobnissen](https://discourse.julialang.org/u/jakobnissen)
#### Post date: [June 20, 2022, 9:25am UTC](https://discourse.julialang.org/t/inference-bug-when-using-nested-generators/82991/7 "2022-06-20T09:25:58Z")

</div>

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.

---

_[View the full topic](https://discourse.julialang.org/t/inference-bug-when-using-nested-generators/82991)._
