# How to resolve this 'Unresolved reference'?

**URL:** <https://discuss.kotlinlang.org/t/how-to-resolve-this-unresolved-reference/3109>\
**Category:** Support\
**Created:** [June 4, 2017, 6:55pm UTC](https://discuss.kotlinlang.org/t/how-to-resolve-this-unresolved-reference/3109 "2017-06-04T18:55:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mnaraniya](https://avatars.discourse-cdn.com/v4/letter/m/7bcc69/32.png) [@mnaraniya](https://discuss.kotlinlang.org/u/mnaraniya)\
**Post date:** [June 4, 2017, 6:55pm UTC](https://discuss.kotlinlang.org/t/how-to-resolve-this-unresolved-reference/3109/1 "2017-06-04T18:55:10Z")

</div>

![](https://us1.discourse-cdn.com/flex019/uploads/kotlinlang/original/2X/1/13ef8233081088ced19fdca7d70fe7471221ba35.png)

---

<div class="post-metadata">

**Author:** ![kirkkaf](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/kirkkaf/32/2701_2.png) [@kirkkaf](https://discuss.kotlinlang.org/u/kirkkaf)\
**Post date:** [June 4, 2017, 10:01pm UTC](https://discuss.kotlinlang.org/t/how-to-resolve-this-unresolved-reference/3109/2 "2017-06-04T22:01:10Z")

</div>

Hello,

You must declare your function before calling it, move your declaration of nextTwo() above the call.

```
fun nextTwo(num: Int) : Pair<Int, Int>{
    return Pair(num+1, num+10)
}

val (two, three) = nextTwo(1)
println("1, $two, $three")

```

---

<div class="post-metadata">

**Author:** ![mnaraniya](https://avatars.discourse-cdn.com/v4/letter/m/7bcc69/32.png) [@mnaraniya](https://discuss.kotlinlang.org/u/mnaraniya)\
**Post date:** [June 5, 2017, 3:01pm UTC](https://discuss.kotlinlang.org/t/how-to-resolve-this-unresolved-reference/3109/3 "2017-06-05T15:01:08Z")

</div>

thanks.
