Skip to content

Commit dc619e5

Browse files
committed
Scala.js: Do not crash on Match nodes.
Instead emit a placeholder `throw null`. Actually producing correct code for `Match` nodes is deferred for now.
1 parent 5683f2f commit dc619e5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

compiler/src/dotty/tools/backend/sjs/JSCodeGen.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,8 +1012,10 @@ class JSCodeGen()(implicit ctx: Context) {
10121012
genJavaSeqLiteral(javaSeqLiteral)
10131013

10141014
/** A Match reaching the backend is supposed to be optimized as a switch */
1015-
/*case mtch: Match =>
1016-
genMatch(mtch, isStat)*/
1015+
case mtch: Match =>
1016+
// TODO Correctly handle `Match` nodes
1017+
//genMatch(mtch, isStat)
1018+
js.Throw(js.Null())
10171019

10181020
case tree: Closure =>
10191021
genClosure(tree)

0 commit comments

Comments
 (0)