问题描述
在let
块中,有时在语句前会看到^let
批注,但我不清楚它们的含义或原因.
In a let
block, I sometimes see ^let
annotations before my statements, and it's not clear to me what they mean or why they are there.
是否表示将返回一个值作为let
调用的值?
Is it to indicate that a value will be returned as the value of the let
call?
屏幕截图:
推荐答案
这些实际上向您展示了这些值将从let
表达式返回.如果将光标移至这些提示之一并打开意图动作(Alt + Enter),则会得到不显示 lambda返回表达式提示"选项,我想这是此新名称的名称.功能.
These do in fact show you that those values are going to be returned from the let
expression. If you move to cursor to one of these hints and open intention actions (Alt + Enter), you get the option "Do not show lambda return expression hints", which I suppose is the name for this new feature.
此更改是Kotlin 1.2.20中引入的,请参阅IntelliJ IDEA插件改进. -2-20-is-out/"rel =" noreferrer>此信息.
This change was introduced in Kotlin 1.2.20, see IntelliJ IDEA Plugin Improvements in this post.
这篇关于Android Studio/IntelliJ中的`^ let`注释是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!