Skip to content

Commit a445cc5

Browse files
authored
Fix last from empty statements bug in CPSTransformer (#871)
1 parent c2d6f3e commit a445cc5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

effekt/shared/src/main/scala/effekt/generator/js/TransformerCps.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,8 @@ object TransformerCps extends Transformer {
250250

251251
val stmts = binding.stmts
252252

253-
stmts.last match {
254-
case terminator : (js.Stmt.Return | js.Stmt.Break | js.Stmt.Continue) => (e, stmts)
253+
stmts.lastOption match {
254+
case Some(terminator : (js.Stmt.Return | js.Stmt.Break | js.Stmt.Continue)) => (e, stmts)
255255
case other => (e, stmts :+ js.Break())
256256
}
257257
},

0 commit comments

Comments
 (0)