title: Optional generic parameter
body: <p>I need to use an optional generic parameter for a function. This would be the normal function without the generic parameter:</p>
  
  <pre><code>void MyFunction (string myText, int optionalParameter = 0)
  {
   //Do something
  }
  </code></pre>
  
  <p>What I need is this:</p>
  
  <pre><code>void MyFunction&lt;T&gt; (string myText, T optionalGenericParameter = default(T))
  {
    //Do something
  }
  </code></pre>
  
  <p>Unfortunately the initialization to <code>default(T)</code> is throwing the following error "cannot be inferred from the usage. Try specifying the type arguments explicitly."</p>