title: Default value for type parameter in Scala
body: <p>I'm failing to figure out how (if at all) you can set a default value for a <em>type</em>-parameter in Scala.<br>
  Currently I have a method similar to this:</p>
  
  <pre><code>def getStage[T &lt;: Stage](key: String): T = {
    // Do fancy stuff that returns something
  }
  </code></pre>
  
  <p>But what I'd like to do is provide an implementation of <code>getStage</code> that takes no value for <code>T</code> and uses a default value instead. I tried to just define another method and overload the parameters, but it only leads to one of the methods being completely overriden by the other one. If I have not been clear what I'm trying to do is something like this:</p>
  
  <pre><code>def getStage[T&lt;:Stage = Stage[_]](key: String): T = {
  
  }
  </code></pre>
  
  <p>I hope it's clear what I'm asking for. Does anyone know how something like this could be achieved?</p>