wu-lang/wu

[visitor] False-positive implicit return in if-expressions

nilq opened this issue · 1 comments

nilq commented

The visitor is marking expressions at the end of if-expressions as implicit returns, even if it isn't the real last expression of the root block.

import lover { grahics }

foo: fun -> int {
  if false {
    # returns here
    graphics setColor(1, 1, 0)
  }

  if true {
    # properly inserts return here too
    200
  }
}
nilq commented

This has been fixed. Let's go.