Skip to content

Commit

Permalink
ir: annotate refutable pattern bindings as @unchecked
Browse files Browse the repository at this point in the history
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 (scala/scala3#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.
  • Loading branch information
griggt committed Feb 9, 2022
1 parent 12285ab commit 0827130
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ir/shared/src/main/scala/org/scalajs/ir/Trees.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0827130

Please sign in to comment.