title: SAM Conversion with Generics
body: <p>I have my interfaced defined like so:</p>
  
  <pre><code>interface OnItemClickDelegate&lt;T: Entity&gt; {
      fun onItemClick(entity: T?)
  }
  </code></pre>
  
  <p>Right now I have my interfaced defined anonymously in a different class:</p>
  
  <pre><code>var itemClickDelegate = object : OnItemClickDelegate&lt;Derived&gt; {
          override fun onItemClick(entity: Derived?) {
              doSomethingWith(entity)
          }
      }
  </code></pre>
  
  <p>This compiles fine, but when I switch it to:</p>
  
  <pre><code>var itemClickDelegate = OnItemClickDelegate&lt;Derived&gt; { entity -&gt; doSomethingWith(entity) }
  </code></pre>
  
  <p>I get a compiler error saying:</p>
  
  <pre><code>Interface OnItemClickDelegate does not have constructors
  </code></pre>
  
  <p>How do I write my declaration in short notation?</p>