# Feature request: Add support for custom operators

**URL:** <https://discuss.kotlinlang.org/t/feature-request-add-support-for-custom-operators/30124>\
**Category:** Language Design\
**Created:** [March 20, 2025, 11:34am UTC](https://discuss.kotlinlang.org/t/feature-request-add-support-for-custom-operators/30124 "2025-03-20T11:34:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alkozin](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/alkozin/32/11143_2.png) [@alkozin](https://discuss.kotlinlang.org/u/alkozin)\
**Post date:** [March 20, 2025, 11:34am UTC](https://discuss.kotlinlang.org/t/feature-request-add-support-for-custom-operators/30124/1 "2025-03-20T11:34:08Z")

</div>

Hello mates!

In Swift it’s possible to create custom operators like this:

```auto
prefix operator |
postfix operator |
infix operator | : AdditionPrecedence

```

But in Kotlin you can only use predefined set or letters like ‘I’ for operators.

It will be incredible if you add support for any operators in the future ☺

So it will be possible to make the translation of ‘The Wand: Declarative programming language for error-free coding’ also to Kotlin. And we will support all actual mobile ecosystems.

> **[GitHub - The-Wand/Wand: Declarative Programming Language 📦 For error-free...](https://github.com/The-Wand/Wand)**
>
> Declarative Programming Language 📦 For error-free coding

---

<div class="post-metadata">

**Author:** ![kyay10](https://avatars.discourse-cdn.com/v4/letter/k/c57346/32.png) [@kyay10](https://discuss.kotlinlang.org/u/kyay10)\
**Post date:** [March 20, 2025, 11:55am UTC](https://discuss.kotlinlang.org/t/feature-request-add-support-for-custom-operators/30124/2 "2025-03-20T11:55:23Z")

</div>

This might be unlikely to be added.  
In the meantime though, you might wanna check out my [IntelliJ Plugin](https://github.com/kyay10/prettify-kotlin) that uses folding regions to have the code display as if those were operators.  
For instance:

```auto
@Pretty("~")
@Prefix("", "")
fun inv(foo: Foo)

@Postfix("", "")
val Int.c

@Pretty("&")
infix fun Int.and(other: Int)

inv(foo) // Displays as ~foo
5.c // Displays as 5c
5 and 10 // displays as 5 & 10
```

---

<div class="post-metadata">

**Author:** ![alkozin](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/alkozin/32/11143_2.png) [@alkozin](https://discuss.kotlinlang.org/u/alkozin)\
**Post date:** [March 24, 2025, 3:27pm UTC](https://discuss.kotlinlang.org/t/feature-request-add-support-for-custom-operators/30124/3 "2025-03-24T15:27:17Z")

</div>

Thanks for your plugin- looks amazing. Great work, right thing that I need 👍
