Browsing source code of kotlin.kotlin_builtins like the .. operator

I’m always interested in understanding how things a working especially within the Kotlin Standard Library to grasp a better and more complete understanding of the language and its properties.

In IDEA / Android Studio I can navigate i.e. to methods Iterable.flatMap(), but clicking on a .. operator leads me to a generated stub file without any code. Also I do not have any KDoc on these elements.

Are these methods not backed with implementation code?

Currently, navigation to builtin sources may not work as expected in maven/gradle projects.

You can find sources of builtins here kotlin/core/builtins at master · JetBrains/kotlin · GitHub.
Note that the ‘native’ part of them do not have implementation bodies, as they are implemented as compiler intrinsics.

If you’re more interested in what they are compiled to, you can inspect the generated bytecode with the “Show Kotlin bytecode” action.

1 Like

Thanks @ilya.gorbunov. Great answer which leaves none of my questions open!