Extension function with multiple upper bounds


I got "receiver type mismatch" when trying to use doSomething(). Is there something wrong with my code or it's bug in kotlin?

trait FirstTrait trait SecondTrait

fun <T> T.doSomething() where T: FirstTrait, T: SecondTrait {

class Foo: FirstTrait, SecondTrait {
  fun bar() {


Looks like a bug in Kotlin, please report to the tracker