Florian
06/20/2019, 7:16 PMDominaezzz
06/20/2019, 7:19 PM= is a statement and not an expression.Dominaezzz
06/20/2019, 7:20 PMb = 3 doesn't evaluate to any value.Dominaezzz
06/20/2019, 7:20 PMDominaezzz
06/20/2019, 7:22 PMvar b = 4
fun max(a: Int, b: Int): Int = TODO()
max(a = 2, b = 5)
This would be ambiguous to the compiler, if = was an expression.Florian
06/20/2019, 9:15 PMandym
06/21/2019, 2:59 PMandym
06/21/2019, 2:59 PMboolean isSomeCondition = checkSomeCondition();
if (isSomeCondition = checkSomeOtherCondition()) {
// isSomeCondition now has the 2nd value: it was accidentally assigned, instead of just compared
}andym
06/21/2019, 2:59 PMif() needs an expression.Florian
06/21/2019, 5:20 PMFlorian
06/21/2019, 5:20 PM