|
|
|
|
|
by simias
2966 days ago
|
|
Rust has an interesting take on that, it's not a syntax error to write "if a = 1 { ... }" but it'll fail to compile because the expression "a = true" returns nothing while "if" expects a boolean so it generates a type check error. Of course a consequence of that is that you can't chained affectations (a = b = c) but it's probably a good compromise. |
|