title: How to avoid duplication of type bound in Scala
body: <p>I have a class with a constrained type parameter.</p>
  <p>I've tried with <code>identity</code> but the return type is not precise.</p>
  <p>And in the method <code>identityTP</code>, I need to specify again the constraint</p>
  <p>How to avoid to duplicate this constraint with methods that work on this type ?</p>
  <p>Here is an example :</p>
  <pre><code>  sealed trait Location
    case object Single extends Location
    case object Multi extends Location
  
    final case class Log[L &lt;: Location](l: L)
  
    def identity(log: Log[_]): Log[_] = log
    def identityTP[L&lt;: Location](log: Log[L]): Log[L] = log
  </code></pre>