<@U6S2T6PV0> the problem here is that the lambda e...
# announcements
i
@trent the problem here is that the lambda expression is parsed as a last parameter of the preceding
set
function invocation. There are two ways to overcome this: - surround lambda with parentheses:
({ refreshRightText.set("") })
- place
;
between
set
and the lambda:
Copy code
refreshRightText.set(refreshText);
{ refreshRightText.set("") }
👏 2
t
It would be nice if it is parsed correctly automatically, since there are no matching signature with lambda for
set
function. Are there technical difficulties for this being not parsed as expected?
i
Parsing happens way longer before matching overloads are analyzed.
Even if we were able to delay the interpretation of the lambda in this case until we know is there a matching function, that would be very fragile. Imagine it works this way and you add an overload of
set
with the second parameter of type
Any
. Would you expect that the lambda after
set
with one parameter now changes its meaning?
👍 1
t
Explanation appreciated. I was just curious.