Skip to content

Commit ce5f86b

Browse files
committed
ir: annotate refutable pattern bidings 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 (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.
1 parent 12285ab commit ce5f86b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ir/shared/src/main/scala/org/scalajs/ir/Trees.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1203,7 +1203,7 @@ object Trees {
12031203
case TopLevelJSClassExportDef(_, name) => name
12041204

12051205
case TopLevelMethodExportDef(_, JSMethodDef(_, propName, _, _, _)) =>
1206-
val StringLiteral(name) = propName
1206+
val StringLiteral(name) = propName: @unchecked // unchecked is needed for Scala 3.2+
12071207
name
12081208

12091209
case TopLevelFieldExportDef(_, name, _) => name

0 commit comments

Comments
 (0)