Saw a bug with someone using a right-value operation for a number on a new line, expecting it to work like it did in Java. My manager joked that I should make a meme as a report of this bug.
i
itnoles
05/07/2020, 3:24 AM
Also val i += 1 😉
b
baxter
05/07/2020, 5:14 AM
Wouldn't that be a compiler error, as you are re-assigning
i
, which is a
val
?
👍 1
🚫 1
m
Marc Knaup
05/08/2020, 7:25 PM
I think that behavior is intentional and the stray
+1
will cause an weak “unused” warning in IDE 🤔
But that warning is very easy to miss!
b
baxter
05/09/2020, 3:15 AM
It was actually. When I reviewed the code on github, I kept overlooking it. Even the IDE had the weak warning like you mentioned.