@@ -1032,7 +1032,7 @@ class JSCodeGen()(using genCtx: Context) {
10321032 */
10331033
10341034 val (primaryTree :: Nil , secondaryTrees) =
1035- constructorTrees.partition(_.symbol.isPrimaryConstructor)
1035+ constructorTrees.partition(_.symbol.isPrimaryConstructor): @ unchecked
10361036
10371037 val primaryCtor = genPrimaryJSClassCtor(primaryTree)
10381038 val secondaryCtors = secondaryTrees.map(genSecondaryJSClassCtor(_))
@@ -1113,7 +1113,7 @@ class JSCodeGen()(using genCtx: Context) {
11131113
11141114 private def genPrimaryJSClassCtor (dd : DefDef ): PrimaryJSCtor = {
11151115 val sym = dd.symbol
1116- val Block (stats, _) = dd.rhs
1116+ val Block (stats, _) = dd.rhs: @ unchecked
11171117 assert(sym.isPrimaryConstructor, s " called with non-primary ctor: $sym" )
11181118
11191119 var jsSuperCall : Option [js.JSSuperConstructorCall ] = None
@@ -1186,7 +1186,7 @@ class JSCodeGen()(using genCtx: Context) {
11861186
11871187 assert(thisCall.isDefined,
11881188 i " could not find the this() call in secondary JS constructor at ${dd.sourcePos}: \n ${stats.map(_.show).mkString(" \n " )}" )
1189- val Some ((targetCtor, ctorArgs)) = thisCall
1189+ val Some ((targetCtor, ctorArgs)) = thisCall : @ unchecked
11901190
11911191 new SplitSecondaryJSCtor (sym, genParamsAndInfo(sym, dd.paramss),
11921192 beforeThisCall.result(), targetCtor, ctorArgs, afterThisCall.result())
@@ -2151,7 +2151,7 @@ class JSCodeGen()(using genCtx: Context) {
21512151 */
21522152 private def genSuperCall (tree : Apply , isStat : Boolean ): js.Tree = {
21532153 implicit val pos = tree.span
2154- val Apply (fun @ Select (sup @ Super (qual, _), _), args) = tree
2154+ val Apply (fun @ Select (sup @ Super (qual, _), _), args) = tree : @ unchecked
21552155 val sym = fun.symbol
21562156
21572157 if (sym == defn.Any_getClass ) {
@@ -2192,7 +2192,7 @@ class JSCodeGen()(using genCtx: Context) {
21922192 private def genApplyNew (tree : Apply ): js.Tree = {
21932193 implicit val pos : SourcePosition = tree.sourcePos
21942194
2195- val Apply (fun @ Select (New (tpt), nme.CONSTRUCTOR ), args) = tree
2195+ val Apply (fun @ Select (New (tpt), nme.CONSTRUCTOR ), args) = tree : @ unchecked
21962196 val ctor = fun.symbol
21972197 val tpe = tpt.tpe
21982198
@@ -2241,7 +2241,7 @@ class JSCodeGen()(using genCtx: Context) {
22412241 acquireContextualJSClassValue { jsClassValue =>
22422242 implicit val pos : Position = tree.span
22432243
2244- val Apply (fun @ Select (New (tpt), _), args) = tree
2244+ val Apply (fun @ Select (New (tpt), _), args) = tree : @ unchecked
22452245 val cls = tpt.tpe.typeSymbol
22462246 val ctor = fun.symbol
22472247
@@ -2911,7 +2911,7 @@ class JSCodeGen()(using genCtx: Context) {
29112911
29122912 implicit val pos = tree.span
29132913
2914- val Apply (fun, args) = tree
2914+ val Apply (fun, args) = tree : @ unchecked
29152915 val arrayObj = qualifierOf(fun)
29162916
29172917 val genArray = genExpr(arrayObj)
@@ -3180,7 +3180,7 @@ class JSCodeGen()(using genCtx: Context) {
31803180 private def genJSSuperCall (tree : Apply , isStat : Boolean ): js.Tree = {
31813181 acquireContextualJSClassValue { explicitJSSuperClassValue =>
31823182 implicit val pos = tree.span
3183- val Apply (fun @ Select (sup @ Super (qual, _), _), args) = tree
3183+ val Apply (fun @ Select (sup @ Super (qual, _), _), args) = tree : @ unchecked
31843184 val sym = fun.symbol
31853185
31863186 val genReceiver = genExpr(qual)
@@ -3255,7 +3255,7 @@ class JSCodeGen()(using genCtx: Context) {
32553255 /** Gen JS code for a switch-`Match`, which is translated into an IR `js.Match`. */
32563256 def genMatch (tree : Tree , isStat : Boolean ): js.Tree = {
32573257 implicit val pos = tree.span
3258- val Match (selector, cases) = tree
3258+ val Match (selector, cases) = tree : @ unchecked
32593259
32603260 def abortMatch (msg : String ): Nothing =
32613261 throw new FatalError (s " $msg in switch-like pattern match at ${tree.span}: $tree" )
@@ -3454,7 +3454,7 @@ class JSCodeGen()(using genCtx: Context) {
34543454 val call = if (isStaticCall) {
34553455 genApplyStatic(sym, formalCaptures.map(_.ref) ::: actualParams)
34563456 } else {
3457- val thisCaptureRef :: argCaptureRefs = formalCaptures.map(_.ref)
3457+ val thisCaptureRef :: argCaptureRefs = formalCaptures.map(_.ref): @ unchecked
34583458 if (! sym.owner.isNonNativeJSClass || sym.isJSExposed)
34593459 genApplyMethodMaybeStatically(thisCaptureRef, sym, argCaptureRefs ::: actualParams)
34603460 else
@@ -3471,7 +3471,7 @@ class JSCodeGen()(using genCtx: Context) {
34713471 }
34723472
34733473 if (isThisFunction) {
3474- val thisParam :: otherParams = formalParams
3474+ val thisParam :: otherParams = formalParams : @ unchecked
34753475 js.Closure (
34763476 arrow = false ,
34773477 formalCaptures,
@@ -3983,7 +3983,7 @@ class JSCodeGen()(using genCtx: Context) {
39833983 */
39843984 private def genReflectiveCall (tree : Apply , isSelectDynamic : Boolean ): js.Tree = {
39853985 implicit val pos = tree.span
3986- val Apply (fun @ Select (receiver, _), args) = tree
3986+ val Apply (fun @ Select (receiver, _), args) = tree : @ unchecked
39873987
39883988 val selectedValueTree = js.Apply (js.ApplyFlags .empty, genExpr(receiver),
39893989 js.MethodIdent (selectedValueMethodName), Nil )(jstpe.AnyType )
@@ -4226,7 +4226,7 @@ class JSCodeGen()(using genCtx: Context) {
42264226 private def genCaptureValuesFromFakeNewInstance (tree : Tree ): List [js.Tree ] = {
42274227 implicit val pos : Position = tree.span
42284228
4229- val Apply (fun @ Select (New (_), _), args) = tree
4229+ val Apply (fun @ Select (New (_), _), args) = tree : @ unchecked
42304230 val sym = fun.symbol
42314231
42324232 /* We use the same strategy as genActualJSArgs to detect which parameters were
@@ -4552,7 +4552,7 @@ class JSCodeGen()(using genCtx: Context) {
45524552 pathName.split('.' ).toList
45534553
45544554 def parseGlobalPath (pathName : String ): Global = {
4555- val globalRef :: path = parsePath(pathName)
4555+ val globalRef :: path = parsePath(pathName): @ unchecked
45564556 Global (globalRef, path)
45574557 }
45584558
0 commit comments