title: Implement abstract class with constrained generic in Kotlin
body: <p>Working on Kotlin 1.3.61</p>
  
  <p>Having this code:</p>
  
  <pre><code>abstract class ResourceObserver&lt;T&gt; : Observer&lt;T&gt; where T : Resource&lt;T&gt; {
      override fun onChanged(t: T) {
          when (t.status) {
              Status.LOADING -&gt; { ... }
              Status.ERROR -&gt; { ... }
              Status.SUCCESS -&gt; { onSuccess(t.data) }
          }
      }
  
      abstract fun onSuccess(data: T?)
  }
  </code></pre>
  
  <p>and trying to implement it </p>
  
  <pre><code>private val foo = object : ResourceObserver&lt;Resource&lt;Bar&gt;&gt; {
      override fun onSuccess(data: Bar?) {
          TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
      }
  }
  </code></pre>
  
  <p>Compiler (Android Studio in this case) gives me this error:</p>
  
  <pre><code>Type argument is not within its bounds.
  Expected: Resource&lt;Resource&lt;Bar&gt;&gt;
  Found: Resource&lt;Bar&gt;
  </code></pre>
  
  <p>What is wrong with my obviously erroneous code?</p>