Skip to content

Commit 29d31e9

Browse files
committed
Scala.js: Do not error when trying to assign to an immutable field.
The assertion fails for `OFFSET$x` fields at the moment. We'll re-enable it when that is taken care of.
1 parent e08d269 commit 29d31e9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -981,8 +981,9 @@ class JSCodeGen()(implicit ctx: Context) {
981981
currentMethodSym.get.owner == qualifier.symbol &&
982982
qualifier.isInstanceOf[This]
983983
)
984-
if (!sym.is(Mutable) && !ctorAssignment)
985-
throw new FatalError(s"Assigning to immutable field ${sym.fullName} at $pos")
984+
// TODO This fails for OFFSET$x fields. Re-enable when we can.
985+
/*if (!sym.is(Mutable) && !ctorAssignment)
986+
throw new FatalError(s"Assigning to immutable field ${sym.fullName} at $pos")*/
986987

987988
val genQual = genExpr(qualifier)
988989

0 commit comments

Comments
 (0)