# Extension function with multiple upper bounds

**URL:** <https://discuss.kotlinlang.org/t/extension-function-with-multiple-upper-bounds/620>\
**Category:** Uncategorized\
**Created:** [March 22, 2014, 11:40am UTC](https://discuss.kotlinlang.org/t/extension-function-with-multiple-upper-bounds/620 "2014-03-22T11:40:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AndroidCactus](https://avatars.discourse-cdn.com/v4/letter/a/eb8c5e/32.png) [@AndroidCactus](https://discuss.kotlinlang.org/u/AndroidCactus)\
**Post date:** [March 22, 2014, 11:40am UTC](https://discuss.kotlinlang.org/t/extension-function-with-multiple-upper-bounds/620/1 "2014-03-22T11:40:58Z")

</div>

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

```kotlin
trait FirstTrait
trait SecondTrait

fun <T> T.doSomething() where T: FirstTrait, T: SecondTrait {
  println(“hello”)
}
class Foo: FirstTrait, SecondTrait {
  fun bar() {
  doSomething()
  }
}
```

---

<div class="post-metadata">

**Author:** ![abreslav](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/abreslav/32/8279_2.png) [@abreslav](https://discuss.kotlinlang.org/u/abreslav)\
**Post date:** [March 23, 2014, 9:11am UTC](https://discuss.kotlinlang.org/t/extension-function-with-multiple-upper-bounds/620/2 "2014-03-23T09:11:09Z")

</div>

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