title: Can an infinite recursive dart generator(yield*) stack overflow?
body: <p>I am trying to know if an infinite recursive generator can cause a stack overflow error. I'm not sure if infinite recursion is a correct use case for generators, but I couldn't find any clues about it in the documentation.</p>
  <p>Let's take this example:</p>
  <pre class="lang-dart prettyprint-override"><code>import 'dart:async';
  
  Stream&lt;bool&gt; infiniteStream(bool t) async* {
    yield t;
    await Future.delayed(Duration(milliseconds: 1));
    yield* infiniteStream(!t);
  }
  
  void main() async {
    await for (final value in infiniteStream(true)) {
      print(value);
    }
  }
  </code></pre>
  <p>Is this a correct use of generators? Or will it cause error/performance problems after a long period of time?
  If this is not correct, what is the correct way to implement an infinite stream that can add events to itself in response to received events?</p>
  <p>Also I've noticed that without Future.delayed(), dartpad crashes.</p>