V: Regression: arithmetic assignment ops on unsuitable types should give error

Created on 13 Apr 2020  路  1Comment  路  Source: vlang/v

V version:
latest master - 0.1.26 a6100be (with mingw64)

OS:
win10

What did you do?
Test some arithmetic assignment ops on unsuitable types, e.g. bool += bool.

What did you expect to see?
Give an error.

What did you see instead?
No error.

NB In V1 only the following are allowed.

  1. +=, -=, *=, /= on two numeric types (and += on two strings as an exception)
  2. %=, <<=, >>=, &=, |=, ^= on two integer types
Bug

Most helpful comment

Fixed:

bool types only have the following operators defined: `==`, `!=`, `||`, and `&&`

Still need to do a couple of other checks.

>All comments

Fixed:

bool types only have the following operators defined: `==`, `!=`, `||`, and `&&`

Still need to do a couple of other checks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

medvednikov picture medvednikov  路  3Comments

clpo13 picture clpo13  路  3Comments

radare picture radare  路  3Comments

aurora picture aurora  路  3Comments

jtkirkpatrick picture jtkirkpatrick  路  3Comments