# Can't understand generic bound

**URL:** <https://discuss.kotlinlang.org/t/cant-understand-generic-bound/13535>\
**Category:** Uncategorized\
**Created:** [July 19, 2019, 6:25am UTC](https://discuss.kotlinlang.org/t/cant-understand-generic-bound/13535 "2019-07-19T06:25:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![september669](https://avatars.discourse-cdn.com/v4/letter/s/3bc359/32.png) [@september669](https://discuss.kotlinlang.org/u/september669)\
**Post date:** [July 19, 2019, 6:25am UTC](https://discuss.kotlinlang.org/t/cant-understand-generic-bound/13535/1 "2019-07-19T06:25:33Z")

</div>

```
public inline fun <C, R> C.ifEmpty(defaultValue: () -> R): R where C : CharSequence, C : R =
    if (isEmpty()) defaultValue() else this

```

This func declared in the kotlin.text.Strings.kt  
Coud someone explain how to work generic bound for C : R ?  
And if i write something like “where C : CharSequence, C : R” in my own func i got a compile error: "Type parameter cannot have any other bounds if it’s bounded by another type parameter:

---

<div class="post-metadata">

**Author:** ![september669](https://avatars.discourse-cdn.com/v4/letter/s/3bc359/32.png) [@september669](https://discuss.kotlinlang.org/u/september669)\
**Post date:** [July 19, 2019, 11:21am UTC](https://discuss.kotlinlang.org/t/cant-understand-generic-bound/13535/2 "2019-07-19T11:21:57Z")

</div>

Correct bounds will be: where R : CharSequence, C: R
