From 0827130789fa561a6c77021011f86e98283e8025 Mon Sep 17 00:00:00 2001 From: Tom Grigg Date: Wed, 2 Feb 2022 16:42:01 -0800 Subject: [PATCH] ir: annotate refutable pattern bindings as @unchecked Beginning in Scala 3.2, refutable pattern bindings will warn by default, see https://dotty.epfl.ch/docs/reference/changed-features/pattern-bindings.html Since the scalajs-ir code is unpacked and recompiled from source as part of the Scala 3 build, which uses -Xfatal-warnings, we suppress the warning here with an @unchecked annotation to unblock the dotty PR (lampepfl/dotty#14294) introducing this behavioral change. This commit does not address such usage in any other portion of the codebase, which may need to be addressed at a future date. --- ir/shared/src/main/scala/org/scalajs/ir/Trees.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ir/shared/src/main/scala/org/scalajs/ir/Trees.scala b/ir/shared/src/main/scala/org/scalajs/ir/Trees.scala index 4177eceed2..85a77eead6 100644 --- a/ir/shared/src/main/scala/org/scalajs/ir/Trees.scala +++ b/ir/shared/src/main/scala/org/scalajs/ir/Trees.scala @@ -1203,7 +1203,7 @@ object Trees { case TopLevelJSClassExportDef(_, name) => name case TopLevelMethodExportDef(_, JSMethodDef(_, propName, _, _, _)) => - val StringLiteral(name) = propName + val StringLiteral(name) = propName: @unchecked // unchecked is needed for Scala 3.2+ name case TopLevelFieldExportDef(_, name, _) => name