If I'm on 2.2.21, is it safe to enable unnamed loc...
# javascript
e
If I'm on 2.2.21, is it safe to enable unnamed local variables? Or are there known issues for K/JS?
a
@dmitriy.novozhilov ^^
I don't know any specific issues for the JS target
d
This feature enables together with Return Value Checker, which is experimental since 2.3. I can't guarantee that the implementation from 2.2.21 is ready to use (in a sense that there are no bugs and it's alligned with the final design).
r
What are unnamed local variables?
d
Copy code
fun foo(): String = "hello"

fun test() {
    foo() // warning: result of `foo()` is not used
    val _ = foo() // green code
}
The main use-case for them is to provide a syntax to "consume" the value which should be used but you actually don't want it. For more details check the KEEP which I linked in the previous message.
thank you color 1
e
Thank you! I'll just avoid it for now, and wait for an update to 2.3.0/10. @dmitriy.novozhilov can the new return value checker be turned off via compiler args btw?
e
Ahhh it's opt-in, nice. Thanks!