Closed
Description
Not completely sure this is a bug, but to me whether a method is inlined or not should not affect the order of execution.
Compiler version
v3.1.0-RC3
Minimized code
var res = ""
trait Bar:
def +(that: Bar): Bar = new Plus(this, that)
inline def -(that: Bar): Bar = new Minus(this, that)
class LHS extends Bar {res += "LHS "}
class RHS extends Bar {res += "RHS "}
class Plus(lhs: Bar, rhs: Bar) extends Bar {res += "op"}
class Minus(lhs: Bar, rhs: Bar) extends Bar {res += "op"}
@main def main : Unit =
val pls = new LHS + new RHS
val plsRes = res
res = ""
val min = new LHS - new RHS
assert(plsRes == res)
Output
assertion failed
Expectation
No failure. Inlining should not affect the execution order.