How to see source code of a fun in Kotlin in Android Studio 3.1.3?
How to see source code of a fun in Kotlin in Android Studio 3.1.3?
I hope to see the source code of the fun let
, but I get the following content after I ctrl + click data?.let
.
let
data?.let
How to ee source code of a fun in Kotlin in Android Studio 3.1.3?
@kotlin.internal.InlineOnly public inline fun <T, R> T.let(block: (T) -> R): R /* compiled code */
Added Content
Looking for an answer drawing from credible and/or official sources.
1 Answer
1
I can see the source code of let
in kotlin-stdlib-common-1.2.51.jar
where path is kotlin -> Standard.kt (or file name showing as StandardKt.kotlin_metadata)
. I am doing same command.
let
kotlin-stdlib-common-1.2.51.jar
kotlin -> Standard.kt (or file name showing as StandardKt.kotlin_metadata)
Below is code of that fun
fun
/**
* Calls the specified function [block] with `this` value as its argument and returns its result.
*/
@kotlin.internal.InlineOnly
public inline fun <T, R> T.let(block: (T) -> R): R
contract
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
return block(this)
Versions I am using are
Android Studio 3.1.3
Build #AI-173.4819257, built on June 4, 2018
JRE: 1.8.0_152-release-1024-b01 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Mac OS X 10.12.6
And kotlin version is Version: 1.2.51-release-Studio3.1-1
.let
@HelloCW What is version of kotlin?
– Pankaj Kumar
Jul 26 at 6:13
@HelloCW At attached screenshot you are getting option to download "source code". Try that option.
– Pankaj Kumar
Jul 26 at 6:19
None after I click "Download Sources" button.
– HelloCW
Jul 26 at 6:41
@HelloCW Can you please share your gradle config only kotlin related entries
– Pankaj Kumar
Jul 26 at 8:33
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Thanks! Would you please to see my added content in the question? I can't get it when I click
.let
key using Ctrl+Click in Windows 7 64bit OS + Android Studio.– HelloCW
Jul 26 at 5:58