You have a formatting error. You need to move the ...
# language-proposals
r
You have a formatting error. You need to move the
{
to the same line as the
let
s
Yes i know, i mean what are the reasons why it’s not allowed ^^
r
Ah, I see. In that case, I don't know, but this isn't the right channel to ask. Read the channel topic:
All discussion in this channel should begin with a use-case or proposal instead of a question.
k
I'd guess it's because a newline basically counts as a
;
A puzzler:
Copy code
val a = longExpressionThatbasicallyTakesUpTheWholeLine
    + 2
I've been bitten by this a bunch of times.
r
@karelpeeters Not true. For example, the following requires an explicit
;
to avoid exactly what @sksk is trying to do:
Copy code
val callback: () -> Unit = if (true) {
    test();  // required ;
    { println("yep") }
} else {
    test();  // required ;
    { println("nope") }
}
Without the
;
, it thinks it's a param to
test
.
@sksk Interestingly, this works just fine:
Copy code
_screen?.let()
{
    it.pause()
    _prevScreen = it
}
s
oh you are right i tested it works fine
r
It may be a bug. You should file it.