You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue lampepfl#7113: Fix Scala.js codegen for Explicit Returns
In order to use an explicit return statement in Scala.js IR, a label
must be placed wrapping the whole function body to serve as a jump/break
point for all control structures inside the function. While a fresh return
label had been generated for such methods (in the LocalNameGenerator),
it had not been placed at the top level of its method, and was otherwise
unused. This affected the tree created by the TailRec MiniPhase, as well
as user-written early return statements.
After generating a method's body, if a enclosing return label had been
generated, use it to wrap the method body (just as Scala 2's JS codegen
does) for such breaks.
Enable the tests of ReadersTest.scala of the Scala.js test suite, of
which InputStreamReaderTest used a tail-recursive method that depended
on this fix.
0 commit comments