asoffer / Icarus

An experimental general-purpose programming language
Apache License 2.0
9 stars 2 forks source link

ir::Integer type doesn't support *= #92

Closed perimosocordiae closed 2 years ago

perimosocordiae commented 2 years ago

This one fails in a funky way:

x := 1
x *= 2

Error message:

[140472633321288 :0] Assertion failed
    Expected: found == true
         LHS: false
         RHS: true

Note that this does work for x += 2, somehow.

perimosocordiae commented 2 years ago

Also if you change the first line to x: i64 = 1 then everything works as expected.

asoffer commented 2 years ago

It's rather annoying, but the "correct" fix here according to the intended language semantics at the moment would be to emit an error on x := 1, because you can't use integer at run-time.

perimosocordiae commented 2 years ago

Related crash with the same error message: casting an integer to f64:

x := 1
x as f64