# ""Named arguments are not allowed for function types"

**URL:** https://discuss.kotlinlang.org/t/named-arguments-are-not-allowed-for-function-types/5850
**Category:** Uncategorized
**Created:** [December 15, 2017, 6:16pm UTC](https://discuss.kotlinlang.org/t/named-arguments-are-not-allowed-for-function-types/5850 "2017-12-15T18:16:28Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![tedhenry100](https://avatars.discourse-cdn.com/v4/letter/t/ecccb3/32.png) [@tedhenry100](https://discuss.kotlinlang.org/u/tedhenry100)
#### Post date: [December 15, 2017, 6:16pm UTC](https://discuss.kotlinlang.org/t/named-arguments-are-not-allowed-for-function-types/5850/1 "2017-12-15T18:16:29Z")

</div>

I have quite a few functions that I fix some of the arguments like partial application before injecting the new function into some other function. I’d like to be able to call the resulting function using named arguments.

The following works

```
fun add(a: Int, b: Int): Int {
    return a + b;
}

fun createIncrementer(a: Int): (Int) -> Int {
    return fun (b: Int): Int {
        return add(a = a, b = b);
    }
}

val plusOne = createIncrementer(a = 1);

Log.d("asdf", "add(a = 1, b = 2) returns " + add(a = 1, b = 2));
Log.d("asdf", "plusOne(2) returns " + plusOne(2));

```

But for better readability, I’d like to be able to write

```
Log.d("asdf", "plusOne(b = 2) returns " + plusOne(b = 2));

```

I see the following at [https://jetbrains.github.io/kotlin-spec/#\_misc](https://jetbrains.github.io/kotlin-spec/#_misc)

> TODO: named arguments are not allowed for function types (both in () and .invoke() invocations)

Does this mean named arguments are coming or is this a note to document that they are not coming?

Thanks!

---

<div class="post-metadata">

### Author: ![yole](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/yole/32/1425_2.png) [@yole](https://discuss.kotlinlang.org/u/yole)
#### Post date: [December 18, 2017, 11:06am UTC](https://discuss.kotlinlang.org/t/named-arguments-are-not-allowed-for-function-types/5850/2 "2017-12-18T11:06:19Z")

</div>

There is no short- or medium-term plan to add support for named arguments in function types. The TODO means that the restriction needs to be documented.

---

<div class="post-metadata">

### Author: ![tedhenry100](https://avatars.discourse-cdn.com/v4/letter/t/ecccb3/32.png) [@tedhenry100](https://discuss.kotlinlang.org/u/tedhenry100)
#### Post date: [June 27, 2018, 1:29pm UTC](https://discuss.kotlinlang.org/t/named-arguments-are-not-allowed-for-function-types/5850/3 "2018-06-27T13:29:47Z")

</div>

After another 6 months working with Kotlin, I still think that named arguments for functions would be a valuable addition and make the language more uniform.

---

<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: [June 27, 2018, 4:38pm UTC](https://discuss.kotlinlang.org/t/named-arguments-are-not-allowed-for-function-types/5850/4 "2018-06-27T16:38:50Z")

</div>

Agreed they would be nice to have, but that does not mean it is a high priority. Named arguments for function types IMO would be nice but they are not necessary and it’s not a feature that would be used often even if it existed.  
I think currently there are more important features to work on (serialization, coroutines, native, everything in KEEP, etc).
