@@ -1026,7 +1026,7 @@ class JSCodeGen()(using genCtx: Context) {
10261026 */
10271027
10281028 val (primaryTree :: Nil , secondaryTrees) =
1029- constructorTrees.partition(_.symbol.isPrimaryConstructor)
1029+ constructorTrees.partition(_.symbol.isPrimaryConstructor): @ unchecked
10301030
10311031 val primaryCtor = genPrimaryJSClassCtor(primaryTree)
10321032 val secondaryCtors = secondaryTrees.map(genSecondaryJSClassCtor(_))
@@ -1107,7 +1107,7 @@ class JSCodeGen()(using genCtx: Context) {
11071107
11081108 private def genPrimaryJSClassCtor (dd : DefDef ): PrimaryJSCtor = {
11091109 val sym = dd.symbol
1110- val Block (stats, _) = dd.rhs
1110+ val Block (stats, _) = dd.rhs: @ unchecked
11111111 assert(sym.isPrimaryConstructor, s " called with non-primary ctor: $sym" )
11121112
11131113 var jsSuperCall : Option [js.JSSuperConstructorCall ] = None
@@ -1180,7 +1180,7 @@ class JSCodeGen()(using genCtx: Context) {
11801180
11811181 assert(thisCall.isDefined,
11821182 i " could not find the this() call in secondary JS constructor at ${dd.sourcePos}: \n ${stats.map(_.show).mkString(" \n " )}" )
1183- val Some ((targetCtor, ctorArgs)) = thisCall
1183+ val Some ((targetCtor, ctorArgs)) = thisCall : @ unchecked
11841184
11851185 new SplitSecondaryJSCtor (sym, genParamsAndInfo(sym, dd.paramss),
11861186 beforeThisCall.result(), targetCtor, ctorArgs, afterThisCall.result())
@@ -2145,7 +2145,7 @@ class JSCodeGen()(using genCtx: Context) {
21452145 */
21462146 private def genSuperCall (tree : Apply , isStat : Boolean ): js.Tree = {
21472147 implicit val pos = tree.span
2148- val Apply (fun @ Select (sup @ Super (qual, _), _), args) = tree
2148+ val Apply (fun @ Select (sup @ Super (qual, _), _), args) = tree : @ unchecked
21492149 val sym = fun.symbol
21502150
21512151 if (sym == defn.Any_getClass ) {
@@ -2186,7 +2186,7 @@ class JSCodeGen()(using genCtx: Context) {
21862186 private def genApplyNew (tree : Apply ): js.Tree = {
21872187 implicit val pos : SourcePosition = tree.sourcePos
21882188
2189- val Apply (fun @ Select (New (tpt), nme.CONSTRUCTOR ), args) = tree
2189+ val Apply (fun @ Select (New (tpt), nme.CONSTRUCTOR ), args) = tree : @ unchecked
21902190 val ctor = fun.symbol
21912191 val tpe = tpt.tpe
21922192
@@ -2235,7 +2235,7 @@ class JSCodeGen()(using genCtx: Context) {
22352235 acquireContextualJSClassValue { jsClassValue =>
22362236 implicit val pos : Position = tree.span
22372237
2238- val Apply (fun @ Select (New (tpt), _), args) = tree
2238+ val Apply (fun @ Select (New (tpt), _), args) = tree : @ unchecked
22392239 val cls = tpt.tpe.typeSymbol
22402240 val ctor = fun.symbol
22412241
@@ -2904,7 +2904,7 @@ class JSCodeGen()(using genCtx: Context) {
29042904
29052905 implicit val pos = tree.span
29062906
2907- val Apply (fun, args) = tree
2907+ val Apply (fun, args) = tree : @ unchecked
29082908 val arrayObj = qualifierOf(fun)
29092909
29102910 val genArray = genExpr(arrayObj)
@@ -3173,7 +3173,7 @@ class JSCodeGen()(using genCtx: Context) {
31733173 private def genJSSuperCall (tree : Apply , isStat : Boolean ): js.Tree = {
31743174 acquireContextualJSClassValue { explicitJSSuperClassValue =>
31753175 implicit val pos = tree.span
3176- val Apply (fun @ Select (sup @ Super (qual, _), _), args) = tree
3176+ val Apply (fun @ Select (sup @ Super (qual, _), _), args) = tree : @ unchecked
31773177 val sym = fun.symbol
31783178
31793179 val genReceiver = genExpr(qual)
@@ -3248,7 +3248,7 @@ class JSCodeGen()(using genCtx: Context) {
32483248 /** Gen JS code for a switch-`Match`, which is translated into an IR `js.Match`. */
32493249 def genMatch (tree : Tree , isStat : Boolean ): js.Tree = {
32503250 implicit val pos = tree.span
3251- val Match (selector, cases) = tree
3251+ val Match (selector, cases) = tree : @ unchecked
32523252
32533253 def abortMatch (msg : String ): Nothing =
32543254 throw new FatalError (s " $msg in switch-like pattern match at ${tree.span}: $tree" )
@@ -3447,7 +3447,7 @@ class JSCodeGen()(using genCtx: Context) {
34473447 val call = if (isStaticCall) {
34483448 genApplyStatic(sym, formalCaptures.map(_.ref) ::: actualParams)
34493449 } else {
3450- val thisCaptureRef :: argCaptureRefs = formalCaptures.map(_.ref)
3450+ val thisCaptureRef :: argCaptureRefs = formalCaptures.map(_.ref): @ unchecked
34513451 if (! sym.owner.isNonNativeJSClass || sym.isJSExposed)
34523452 genApplyMethodMaybeStatically(thisCaptureRef, sym, argCaptureRefs ::: actualParams)
34533453 else
@@ -3464,7 +3464,7 @@ class JSCodeGen()(using genCtx: Context) {
34643464 }
34653465
34663466 if (isThisFunction) {
3467- val thisParam :: otherParams = formalParams
3467+ val thisParam :: otherParams = formalParams : @ unchecked
34683468 js.Closure (
34693469 arrow = false ,
34703470 formalCaptures,
@@ -3976,7 +3976,7 @@ class JSCodeGen()(using genCtx: Context) {
39763976 */
39773977 private def genReflectiveCall (tree : Apply , isSelectDynamic : Boolean ): js.Tree = {
39783978 implicit val pos = tree.span
3979- val Apply (fun @ Select (receiver, _), args) = tree
3979+ val Apply (fun @ Select (receiver, _), args) = tree : @ unchecked
39803980
39813981 val selectedValueTree = js.Apply (js.ApplyFlags .empty, genExpr(receiver),
39823982 js.MethodIdent (selectedValueMethodName), Nil )(jstpe.AnyType )
@@ -4219,7 +4219,7 @@ class JSCodeGen()(using genCtx: Context) {
42194219 private def genCaptureValuesFromFakeNewInstance (tree : Tree ): List [js.Tree ] = {
42204220 implicit val pos : Position = tree.span
42214221
4222- val Apply (fun @ Select (New (_), _), args) = tree
4222+ val Apply (fun @ Select (New (_), _), args) = tree : @ unchecked
42234223 val sym = fun.symbol
42244224
42254225 /* We use the same strategy as genActualJSArgs to detect which parameters were
@@ -4545,7 +4545,7 @@ class JSCodeGen()(using genCtx: Context) {
45454545 pathName.split('.' ).toList
45464546
45474547 def parseGlobalPath (pathName : String ): Global = {
4548- val globalRef :: path = parsePath(pathName)
4548+ val globalRef :: path = parsePath(pathName): @ unchecked
45494549 Global (globalRef, path)
45504550 }
45514551
0 commit comments