effekt-lang / effekt

A research language with effect handlers and lightweight effect polymorphism

Home Page:https://effekt-lang.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Overeager JS inliner forgets to parenthesize

jiribenes opened this issue · comments

Continuing from #493, we haven't solved the general issue: the JS inliner is great at inlining, but it might inline (s1 + s2).length into s1 + s2.length without the parentheses.

Here's an example from @marvinborner from #493 which showcases similar buggy behaviour:

> "abc" == "def"
false
> ("abc" == "def").not
false
> not ("abc" == "def")
false
> val huh = "abc" == "def"
> huh.not
true

Inductively, it should be enough to always parenthesize the spliced expressions.