# WHY ISN'T THIS WORKING! Unresolved refrence

**URL:** <https://discuss.kotlinlang.org/t/why-isnt-this-working-unresolved-refrence/18524>\
**Category:** Uncategorized\
**Created:** [July 22, 2020, 5:35pm UTC](https://discuss.kotlinlang.org/t/why-isnt-this-working-unresolved-refrence/18524 "2020-07-22T17:35:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sevdat1999](https://avatars.discourse-cdn.com/v4/letter/s/7feea3/32.png) [@sevdat1999](https://discuss.kotlinlang.org/u/sevdat1999)\
**Post date:** [July 22, 2020, 5:35pm UTC](https://discuss.kotlinlang.org/t/why-isnt-this-working-unresolved-refrence/18524/1 "2020-07-22T17:35:44Z")

</div>

fun sayHello(itemToGreet:String) {  
val msg = "Hello " + itemToGreet  
println(msg)  
}

fun main() {  
sayHello(itemToGreet:“Kotlin”)  
sayHello(itemToGreet:“World”)  
}

The second part where fun main where itemToGreet is written gives unresolved refrence

---

<div class="post-metadata">

**Author:** ![Wasabi375](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/wasabi375/32/4741_2.png) [@Wasabi375](https://discuss.kotlinlang.org/u/Wasabi375)\
**Post date:** [July 22, 2020, 6:07pm UTC](https://discuss.kotlinlang.org/t/why-isnt-this-working-unresolved-refrence/18524/2 "2020-07-22T18:07:15Z")

</div>

named arguments use `=` instead of `:` in kotlin. Also the proper way to combine strings is `"Hello$itemToGreet"`.  
Also it would be nice if you could format the code properly and don’t use caps lock in the title. That way people are far more likely to help you.

---

<div class="post-metadata">

**Author:** ![sevdat1999](https://avatars.discourse-cdn.com/v4/letter/s/7feea3/32.png) [@sevdat1999](https://discuss.kotlinlang.org/u/sevdat1999)\
**Post date:** [July 22, 2020, 6:22pm UTC](https://discuss.kotlinlang.org/t/why-isnt-this-working-unresolved-refrence/18524/3 "2020-07-22T18:22:23Z")

</div>

Thank you bro, but I figured it out. All I had to do was to delete itemTogreet instead of writing it. I sat an hour thinking why this doesnt work and a friend told me why. Im pretty emberrased of myself.

---

<div class="post-metadata">

**Author:** ![benwoodworth](https://avatars.discourse-cdn.com/v4/letter/b/ad7895/32.png) [@benwoodworth](https://discuss.kotlinlang.org/u/benwoodworth)\
**Post date:** [July 22, 2020, 6:31pm UTC](https://discuss.kotlinlang.org/t/why-isnt-this-working-unresolved-refrence/18524/4 "2020-07-22T18:31:14Z")

</div>

Lol don’t sweat it. In Kotlin (unlike Swift), parameter names are nearly always optional, and like @Wasabi375 said, you use `=`, and not `:` like Swift 🙂
