title: Return type of an anonymous function
body: <p>I am reading about dart and one think that confuses me is the the syntax for anonymous functions. Specifically, how do I specify the type of the returned value for such a function.</p>
  <p>For example, consider the following:</p>
  <pre><code>var f = (int x) {return x + 1;};
  </code></pre>
  <p>In this instance, I am declaring that the type of the parameter <code>x</code> is <code>int</code>. How can I explicitly say that the function returns an <code>int</code>? I understand that the compiler will probably figure that out using type inference, but I want to explicitly specify the type to prevent the possibility of returning a value of the wrong type when writing more complex functions.</p>