Kotlin type hints in IDEA

Posted by Java developer blog on June 23, 2019

Kotlin type inference is a cool thing. It literally allows you to type less.

However, in some cases it can be confusing which type is returned by a method that is called.

To overcome this issue we could use type hints with help of IDEA.

I checked this feature with IDEA 2019.1.

To enable the feature use the following steps below.

Firstly, look at the simple example below

Secondly, you have to open parameters in Settings/Editor/General/Appearance/Configure, then change language to Kotlin, then check all options. Don’t forget to check Show parameters name hints.

Look at the image below for additional information.

In the end, you will get the result like this below.