title: What is the purpose of `FutureOr`?
body: <p>Dart offers a <a href="https://api.dartlang.org/stable/2.6.1/dart-async/FutureOr-class.html" rel="noreferrer">FutureOr</a> class, that allows writing:</p>
  
  <pre class="lang-dart prettyprint-override"><code>FutureOr&lt;int&gt; future;
  
  future = 42; // valid
  future = Future.value(42); // also valid
  </code></pre>
  
  <p>I would assume that <a href="https://api.dartlang.org/stable/2.6.1/dart-async/FutureOr-class.html" rel="noreferrer">FutureOr</a> would be useful to remove the unnecessary delay caused by the event loop if the value can be read synchronously.</p>
  
  <p>But that doesn't seem to be the case, as showcased by:</p>
  
  <pre class="lang-dart prettyprint-override"><code>import 'dart:async';
  
  void main() async {
    print('START');
    futureOrExample();
    print('END');
  }
  
  void futureOrExample() async {
    FutureOr&lt;int&gt; futureOr = 42;
    print('before await');
    await futureOr;
    print('end await');
  }
  </code></pre>
  
  <p>which prints:</p>
  
  <pre><code>START
  before await
  END
  end await
  </code></pre>
  
  <p>when I would expect:</p>
  
  <pre><code>START
  before await
  end await
  END
  </code></pre>
  
  <p>In that case, why does <a href="https://api.dartlang.org/stable/2.6.1/dart-async/FutureOr-class.html" rel="noreferrer">FutureOr</a> (or more generally <code>await 42</code>) work this way?</p>
  
  <p>Similarly, what's the purpose of <a href="https://api.dartlang.org/stable/2.6.1/dart-async/FutureOr-class.html" rel="noreferrer">FutureOr</a> in that situation since it produces the same result as <a href="https://api.dartlang.org/stable/2.6.1/dart-async/Future-class.html" rel="noreferrer">Future</a>?</p>
  
  <p>I know that I could use <a href="https://api.flutter.dev/flutter/foundation/SynchronousFuture-class.html" rel="noreferrer">SynchronousFuture</a> to achieve the desired result, but I'm just trying to understand what's the use of <a href="https://api.dartlang.org/stable/2.6.1/dart-async/FutureOr-class.html" rel="noreferrer">FutureOr</a>.</p>