Am 12.01.20 um 09:09 schrieb Daniel.Sun:
In Java, `int a = 0; assert a+=1` will fail to compile because expecting
boolean value, but `int a = 0; assert 0 == (a+=1)` is OK, so I think we
forbidden assignments seems not correct...

a long time ago we decided to no allow assignments in certain places
where a boolean is to be expected. That is the after the assert and in
the boolean part of the if. As soon as it gets down to a nested
expression we stop, but top-level we want to forbid it.  Meaning
"if (a+=1)" and "assert a=1" should fail

bye Jochen

Reply via email to