rhai: Parse error on multiplying two switch expressions

switch 1 {} * switch 2 {}
            ^ Unexpected '*' (line 1, position 13)

It works when I parenthesize the first expression:

(switch 1 {}) * switch 2 {}

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 19

Most upvoted comments

Maybe I can restrict the blocks to have only expressions… then it is OK to have if and switch in expressions…

I’m using https://rhai.rs/book/engine/expressions.html. Edit: actually, I’m not using that anymore because for some reason it disallows if and switch expressions, but my primary purpose is still to evaluate expressions.