invalid_condition_if.gravity 269 B

1234567891011121314151617
  1. #unittest {
  2. name: "Semantic, If statement condition, Assignment not allowed here.";
  3. error: SEMANTIC;
  4. error_row: 11;
  5. error_col: 6;
  6. };
  7. func main () {
  8. var i,v = 0;
  9. if (i = 1) { // Assignment not allowed as a condition
  10. v = 1;
  11. v = 2;
  12. } else v = 3;
  13. return v;
  14. }