also compiles and runs from Android Studio:
val greeted = "World".also { println("Hello $it") }
Yet the editor highlights also
and it
as errors and don't give any help with intellisense. apply still works and when I go to source I can see the definition of both apply
and also
. How do I get Android Studio to recognize also
?
I've also had this problem with earlier versions.
The also function was added in Kotlin 1.1 but you have your Language version set to 1.0. Go to your settings/preferences and change the Kotlin version to 1.1.