Extension function with multiple upper bounds


#1

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 {
  println(“hello”)
}

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


#2

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