Skip to content

Commit c92b598

Browse files
committed
Adapt the codebase to strict pattern binding warnings
In order to bootstrap the compiler with the rules now enforced by default by the previous commit.
1 parent 9450702 commit c92b598

File tree

75 files changed

+151
-150
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+151
-150
lines changed

compiler/src/dotty/tools/backend/jvm/BCodeBodyBuilder.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
347347
// but I was able to derrive it by reading
348348
// AbstractValidatingLambdaMetafactory.validateMetafactoryArgs
349349

350-
val DesugaredSelect(prefix, _) = fun
350+
val DesugaredSelect(prefix, _) = fun: @unchecked
351351
genLoad(prefix)
352352
}
353353

@@ -697,7 +697,7 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
697697
lineNumber(app)
698698
app match {
699699
case Apply(_, args) if app.symbol eq defn.newArrayMethod =>
700-
val List(elemClaz, Literal(c: Constant), ArrayValue(_, dims)) = args
700+
val List(elemClaz, Literal(c: Constant), ArrayValue(_, dims)) = args: @unchecked
701701

702702
generatedType = toTypeKind(c.typeValue)
703703
mkArrayConstructorCall(generatedType.asArrayBType, app, dims)
@@ -774,7 +774,7 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
774774
if (invokeStyle.hasInstance) genLoadQualifier(fun)
775775
genLoadArguments(args, paramTKs(app))
776776

777-
val DesugaredSelect(qual, name) = fun // fun is a Select, also checked in genLoadQualifier
777+
val DesugaredSelect(qual, name) = fun: @unchecked // fun is a Select, also checked in genLoadQualifier
778778
val isArrayClone = name == nme.clone_ && qual.tpe.widen.isInstanceOf[JavaArrayType]
779779
if (isArrayClone) {
780780
// Special-case Array.clone, introduced in 36ef60e. The goal is to generate this call
@@ -817,7 +817,7 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
817817
} // end of genApply()
818818

819819
private def genArrayValue(av: tpd.JavaSeqLiteral): BType = {
820-
val ArrayValue(tpt, elems) = av
820+
val ArrayValue(tpt, elems) = av: @unchecked
821821

822822
lineNumber(av)
823823
genArray(elems, tpt)
@@ -1492,7 +1492,7 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
14921492
import ScalaPrimitivesOps.{ ZNOT, ZAND, ZOR, EQ }
14931493

14941494
// lhs and rhs of test
1495-
lazy val DesugaredSelect(lhs, _) = fun
1495+
lazy val DesugaredSelect(lhs, _) = fun: @unchecked
14961496
val rhs = if (args.isEmpty) tpd.EmptyTree else args.head // args.isEmpty only for ZNOT
14971497

14981498
def genZandOrZor(and: Boolean): Unit = {

compiler/src/dotty/tools/backend/jvm/BCodeHelpers.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
151151
// sorting ensures nested classes are listed after their enclosing class thus satisfying the Eclipse Java compiler
152152
for (nestedClass <- allNestedClasses.sortBy(_.internalName.toString)) {
153153
// Extract the innerClassEntry - we know it exists, enclosingNestedClassesChain only returns nested classes.
154-
val Some(e) = nestedClass.innerClassAttributeEntry
154+
val Some(e) = nestedClass.innerClassAttributeEntry: @unchecked
155155
jclass.visitInnerClass(e.name, e.outerName, e.innerName, e.flags)
156156
}
157157
}

compiler/src/dotty/tools/backend/jvm/BCodeSkelBuilder.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ trait BCodeSkelBuilder extends BCodeHelpers {
677677
val origSym = dd.symbol.asTerm
678678
val newSym = makeStatifiedDefSymbol(origSym, origSym.name)
679679
tpd.DefDef(newSym, { paramRefss =>
680-
val selfParamRef :: regularParamRefs = paramRefss.head
680+
val selfParamRef :: regularParamRefs = paramRefss.head: @unchecked
681681
val enclosingClass = origSym.owner.asClass
682682
new TreeTypeMap(
683683
typeMap = _.substThis(enclosingClass, selfParamRef.symbol.termRef)

compiler/src/dotty/tools/backend/sjs/JSCodeGen.scala

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,7 +1025,7 @@ class JSCodeGen()(using genCtx: Context) {
10251025
*/
10261026

10271027
val (primaryTree :: Nil, secondaryTrees) =
1028-
constructorTrees.partition(_.symbol.isPrimaryConstructor)
1028+
constructorTrees.partition(_.symbol.isPrimaryConstructor): @unchecked
10291029

10301030
val primaryCtor = genPrimaryJSClassCtor(primaryTree)
10311031
val secondaryCtors = secondaryTrees.map(genSecondaryJSClassCtor(_))
@@ -1106,7 +1106,7 @@ class JSCodeGen()(using genCtx: Context) {
11061106

11071107
private def genPrimaryJSClassCtor(dd: DefDef): PrimaryJSCtor = {
11081108
val sym = dd.symbol
1109-
val Block(stats, _) = dd.rhs
1109+
val Block(stats, _) = dd.rhs: @unchecked
11101110
assert(sym.isPrimaryConstructor, s"called with non-primary ctor: $sym")
11111111

11121112
var jsSuperCall: Option[js.JSSuperConstructorCall] = None
@@ -1179,7 +1179,7 @@ class JSCodeGen()(using genCtx: Context) {
11791179

11801180
assert(thisCall.isDefined,
11811181
i"could not find the this() call in secondary JS constructor at ${dd.sourcePos}:\n${stats.map(_.show).mkString("\n")}")
1182-
val Some((targetCtor, ctorArgs)) = thisCall
1182+
val Some((targetCtor, ctorArgs)) = thisCall: @unchecked
11831183

11841184
new SplitSecondaryJSCtor(sym, genParamsAndInfo(sym, dd.paramss),
11851185
beforeThisCall.result(), targetCtor, ctorArgs, afterThisCall.result())
@@ -2139,7 +2139,7 @@ class JSCodeGen()(using genCtx: Context) {
21392139
*/
21402140
private def genSuperCall(tree: Apply, isStat: Boolean): js.Tree = {
21412141
implicit val pos = tree.span
2142-
val Apply(fun @ Select(sup @ Super(qual, _), _), args) = tree
2142+
val Apply(fun @ Select(sup @ Super(qual, _), _), args) = tree: @unchecked
21432143
val sym = fun.symbol
21442144

21452145
if (sym == defn.Any_getClass) {
@@ -2180,7 +2180,7 @@ class JSCodeGen()(using genCtx: Context) {
21802180
private def genApplyNew(tree: Apply): js.Tree = {
21812181
implicit val pos: SourcePosition = tree.sourcePos
21822182

2183-
val Apply(fun @ Select(New(tpt), nme.CONSTRUCTOR), args) = tree
2183+
val Apply(fun @ Select(New(tpt), nme.CONSTRUCTOR), args) = tree: @unchecked
21842184
val ctor = fun.symbol
21852185
val tpe = tpt.tpe
21862186

@@ -2229,7 +2229,7 @@ class JSCodeGen()(using genCtx: Context) {
22292229
acquireContextualJSClassValue { jsClassValue =>
22302230
implicit val pos: Position = tree.span
22312231

2232-
val Apply(fun @ Select(New(tpt), _), args) = tree
2232+
val Apply(fun @ Select(New(tpt), _), args) = tree: @unchecked
22332233
val cls = tpt.tpe.typeSymbol
22342234
val ctor = fun.symbol
22352235

@@ -2898,7 +2898,7 @@ class JSCodeGen()(using genCtx: Context) {
28982898

28992899
implicit val pos = tree.span
29002900

2901-
val Apply(fun, args) = tree
2901+
val Apply(fun, args) = tree: @unchecked
29022902
val arrayObj = qualifierOf(fun)
29032903

29042904
val genArray = genExpr(arrayObj)
@@ -3167,7 +3167,7 @@ class JSCodeGen()(using genCtx: Context) {
31673167
private def genJSSuperCall(tree: Apply, isStat: Boolean): js.Tree = {
31683168
acquireContextualJSClassValue { explicitJSSuperClassValue =>
31693169
implicit val pos = tree.span
3170-
val Apply(fun @ Select(sup @ Super(qual, _), _), args) = tree
3170+
val Apply(fun @ Select(sup @ Super(qual, _), _), args) = tree: @unchecked
31713171
val sym = fun.symbol
31723172

31733173
val genReceiver = genExpr(qual)
@@ -3242,7 +3242,7 @@ class JSCodeGen()(using genCtx: Context) {
32423242
/** Gen JS code for a switch-`Match`, which is translated into an IR `js.Match`. */
32433243
def genMatch(tree: Tree, isStat: Boolean): js.Tree = {
32443244
implicit val pos = tree.span
3245-
val Match(selector, cases) = tree
3245+
val Match(selector, cases) = tree: @unchecked
32463246

32473247
def abortMatch(msg: String): Nothing =
32483248
throw new FatalError(s"$msg in switch-like pattern match at ${tree.span}: $tree")
@@ -3441,7 +3441,7 @@ class JSCodeGen()(using genCtx: Context) {
34413441
val call = if (isStaticCall) {
34423442
genApplyStatic(sym, formalCaptures.map(_.ref) ::: actualParams)
34433443
} else {
3444-
val thisCaptureRef :: argCaptureRefs = formalCaptures.map(_.ref)
3444+
val thisCaptureRef :: argCaptureRefs = formalCaptures.map(_.ref): @unchecked
34453445
if (!sym.owner.isNonNativeJSClass || sym.isJSExposed)
34463446
genApplyMethodMaybeStatically(thisCaptureRef, sym, argCaptureRefs ::: actualParams)
34473447
else
@@ -3458,7 +3458,7 @@ class JSCodeGen()(using genCtx: Context) {
34583458
}
34593459

34603460
if (isThisFunction) {
3461-
val thisParam :: otherParams = formalParams
3461+
val thisParam :: otherParams = formalParams: @unchecked
34623462
js.Closure(
34633463
arrow = false,
34643464
formalCaptures,
@@ -3970,7 +3970,7 @@ class JSCodeGen()(using genCtx: Context) {
39703970
*/
39713971
private def genReflectiveCall(tree: Apply, isSelectDynamic: Boolean): js.Tree = {
39723972
implicit val pos = tree.span
3973-
val Apply(fun @ Select(receiver, _), args) = tree
3973+
val Apply(fun @ Select(receiver, _), args) = tree: @unchecked
39743974

39753975
val selectedValueTree = js.Apply(js.ApplyFlags.empty, genExpr(receiver),
39763976
js.MethodIdent(selectedValueMethodName), Nil)(jstpe.AnyType)
@@ -4213,7 +4213,7 @@ class JSCodeGen()(using genCtx: Context) {
42134213
private def genCaptureValuesFromFakeNewInstance(tree: Tree): List[js.Tree] = {
42144214
implicit val pos: Position = tree.span
42154215

4216-
val Apply(fun @ Select(New(_), _), args) = tree
4216+
val Apply(fun @ Select(New(_), _), args) = tree: @unchecked
42174217
val sym = fun.symbol
42184218

42194219
/* We use the same strategy as genActualJSArgs to detect which parameters were
@@ -4539,7 +4539,7 @@ class JSCodeGen()(using genCtx: Context) {
45394539
pathName.split('.').toList
45404540

45414541
def parseGlobalPath(pathName: String): Global = {
4542-
val globalRef :: path = parsePath(pathName)
4542+
val globalRef :: path = parsePath(pathName): @unchecked
45434543
Global(globalRef, path)
45444544
}
45454545

compiler/src/dotty/tools/backend/sjs/JSExportsGen.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ final class JSExportsGen(jsCodeGen: JSCodeGen)(using Context) {
356356
None
357357
} else {
358358
val formalArgsRegistry = new FormalArgsRegistry(1, false)
359-
val (List(arg), None) = formalArgsRegistry.genFormalArgs()
359+
val (List(arg), None) = formalArgsRegistry.genFormalArgs(): @unchecked
360360
val body = genOverloadDispatchSameArgc(jsName, formalArgsRegistry,
361361
setters.map(new ExportedSymbol(_, static)), jstpe.AnyType, None)
362362
Some((arg, body))

compiler/src/dotty/tools/dotc/ast/Desugar.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ object desugar {
395395

396396
/** The expansion of a class definition. See inline comments for what is involved */
397397
def classDef(cdef: TypeDef)(using Context): Tree = {
398-
val impl @ Template(constr0, _, self, _) = cdef.rhs
398+
val impl @ Template(constr0, _, self, _) = cdef.rhs: @unchecked
399399
val className = normalizeName(cdef, impl).asTypeName
400400
val parents = impl.parents
401401
val mods = cdef.mods
@@ -682,7 +682,7 @@ object desugar {
682682
.withMods(companionMods | Synthetic))
683683
.withSpan(cdef.span).toList
684684
if (companionDerived.nonEmpty)
685-
for (modClsDef @ TypeDef(_, _) <- mdefs)
685+
for (case modClsDef @ TypeDef(_, _) <- mdefs)
686686
modClsDef.putAttachment(DerivingCompanion, impl.srcPos.startPos)
687687
mdefs
688688
}
@@ -740,7 +740,7 @@ object desugar {
740740

741741
enumCompanionRef match {
742742
case ref: TermRefTree => // have the enum import watch the companion object
743-
val (modVal: ValDef) :: _ = companions
743+
val (modVal: ValDef) :: _ = companions: @unchecked
744744
ref.watching(modVal)
745745
case _ =>
746746
}
@@ -1200,7 +1200,7 @@ object desugar {
12001200

12011201
/** Expand variable identifier x to x @ _ */
12021202
def patternVar(tree: Tree)(using Context): Bind = {
1203-
val Ident(name) = unsplice(tree)
1203+
val Ident(name) = unsplice(tree): @unchecked
12041204
Bind(name, Ident(nme.WILDCARD)).withSpan(tree.span)
12051205
}
12061206

compiler/src/dotty/tools/dotc/ast/MainProxies.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ object MainProxies {
183183
case TypeDef(_, template: Template) =>
184184
template.body.flatMap((_: Tree) match {
185185
case dd: DefDef if dd.name.is(DefaultGetterName) && dd.name.firstPart == funSymbol.name =>
186-
val DefaultGetterName.NumberedInfo(index) = dd.name.info
186+
val DefaultGetterName.NumberedInfo(index) = dd.name.info: @unchecked
187187
List(index -> dd.symbol)
188188
case _ => Nil
189189
}).toMap

compiler/src/dotty/tools/dotc/ast/TreeInfo.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,7 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
952952
Some(tree.args.head)
953953
else if tree.symbol == defn.QuotedTypeModule_of then
954954
// quoted.Type.of[<body>](quotes)
955-
val TypeApply(_, body :: _) = tree.fun
955+
val TypeApply(_, body :: _) = tree.fun: @unchecked
956956
Some(body)
957957
else None
958958
}

compiler/src/dotty/tools/dotc/ast/TreeTypeMap.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,10 @@ class TreeTypeMap(
153153

154154
private def transformAllParamss(paramss: List[ParamClause]): (TreeTypeMap, List[ParamClause]) = paramss match
155155
case params :: paramss1 =>
156-
val (tmap1, params1: ParamClause) = (params: @unchecked) match
156+
val (tmap1, params1: ParamClause) = ((params: @unchecked) match
157157
case ValDefs(vparams) => transformDefs(vparams)
158158
case TypeDefs(tparams) => transformDefs(tparams)
159+
): @unchecked
159160
val (tmap2, paramss2) = tmap1.transformAllParamss(paramss1)
160161
(tmap2, params1 :: paramss2)
161162
case nil =>

compiler/src/dotty/tools/dotc/ast/tpd.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
293293
ta.assignType(untpd.TypeDef(sym.name, TypeTree(sym.info)), sym)
294294

295295
def ClassDef(cls: ClassSymbol, constr: DefDef, body: List[Tree], superArgs: List[Tree] = Nil)(using Context): TypeDef = {
296-
val firstParent :: otherParents = cls.info.parents
296+
val firstParent :: otherParents = cls.info.parents: @unchecked
297297
val superRef =
298298
if (cls.is(Trait)) TypeTree(firstParent)
299299
else {

compiler/src/dotty/tools/dotc/config/Settings.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ object Settings:
8484
}
8585

8686
def tryToSet(state: ArgsSummary): ArgsSummary = {
87-
val ArgsSummary(sstate, arg :: args, errors, warnings) = state
87+
val ArgsSummary(sstate, arg :: args, errors, warnings) = state: @unchecked
8888
def update(value: Any, args: List[String]): ArgsSummary =
8989
var dangers = warnings
9090
val value1 =

compiler/src/dotty/tools/dotc/core/Annotations.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ object Annotations {
3434
if (i < args.length) Some(args(i)) else None
3535
}
3636
def argumentConstant(i: Int)(using Context): Option[Constant] =
37-
for (ConstantType(c) <- argument(i) map (_.tpe.widenTermRefExpr.normalized)) yield c
37+
for (case ConstantType(c) <- argument(i) map (_.tpe.widenTermRefExpr.normalized)) yield c
3838

3939
def argumentConstantString(i: Int)(using Context): Option[String] =
40-
for (Constant(s: String) <- argumentConstant(i)) yield s
40+
for (case Constant(s: String) <- argumentConstant(i)) yield s
4141

4242
/** The tree evaluaton is in progress. */
4343
def isEvaluating: Boolean = false
@@ -219,7 +219,7 @@ object Annotations {
219219

220220
def unapply(ann: Annotation)(using Context): Option[Symbol] =
221221
if (ann.symbol == defn.ChildAnnot) {
222-
val AppliedType(_, (arg: NamedType) :: Nil) = ann.tree.tpe
222+
val AppliedType(_, (arg: NamedType) :: Nil) = ann.tree.tpe: @unchecked
223223
Some(arg.symbol)
224224
}
225225
else None

compiler/src/dotty/tools/dotc/core/ConstraintHandling.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ trait ConstraintHandling {
263263
(c1 eq constraint)
264264
|| {
265265
constraint = c1
266-
val TypeBounds(lo, hi) = constraint.entry(param)
266+
val TypeBounds(lo, hi) = constraint.entry(param): @unchecked
267267
isSub(lo, hi)
268268
}
269269
end addOneBound
@@ -362,7 +362,7 @@ trait ConstraintHandling {
362362

363363
if level1 != level2 then
364364
boundRemoved = LevelAvoidMap(-1, math.min(level1, level2))(boundRemoved)
365-
val TypeBounds(lo, hi) = boundRemoved
365+
val TypeBounds(lo, hi) = boundRemoved: @unchecked
366366
// After avoidance, the interval might be empty, e.g. in
367367
// tests/pos/i8900-promote.scala:
368368
// >: x.type <: Singleton
@@ -410,7 +410,7 @@ trait ConstraintHandling {
410410
*/
411411
protected final def isSatisfiable(using Context): Boolean =
412412
constraint.forallParams { param =>
413-
val TypeBounds(lo, hi) = constraint.entry(param)
413+
val TypeBounds(lo, hi) = constraint.entry(param): @unchecked
414414
isSub(lo, hi) || {
415415
report.log(i"sub fail $lo <:< $hi")
416416
false

compiler/src/dotty/tools/dotc/core/OrderingConstraint.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ class OrderingConstraint(private val boundsMap: ParamBounds,
512512
if (tl.isInstanceOf[HKLambda]) {
513513
// HKLambdas are hash-consed, need to create an artificial difference by adding
514514
// a LazyRef to a bound.
515-
val TypeBounds(lo, hi) :: pinfos1 = tl.paramInfos
515+
val TypeBounds(lo, hi) :: pinfos1 = tl.paramInfos: @unchecked
516516
paramInfos = TypeBounds(lo, LazyRef.of(hi)) :: pinfos1
517517
}
518518
ensureFresh(tl.newLikeThis(tl.paramNames, paramInfos, tl.resultType))

compiler/src/dotty/tools/dotc/core/TypeComparer.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2150,8 +2150,8 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
21502150
def lubArgs(args1: List[Type], args2: List[Type], tparams: List[TypeParamInfo], canConstrain: Boolean = false): List[Type] =
21512151
tparams match {
21522152
case tparam :: tparamsRest =>
2153-
val arg1 :: args1Rest = args1
2154-
val arg2 :: args2Rest = args2
2153+
val arg1 :: args1Rest = args1: @unchecked
2154+
val arg2 :: args2Rest = args2: @unchecked
21552155
val common = singletonInterval(arg1, arg2)
21562156
val v = tparam.paramVarianceSign
21572157
val lubArg =
@@ -2182,8 +2182,8 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
21822182
def glbArgs(args1: List[Type], args2: List[Type], tparams: List[TypeParamInfo]): List[Type] =
21832183
tparams match {
21842184
case tparam :: tparamsRest =>
2185-
val arg1 :: args1Rest = args1
2186-
val arg2 :: args2Rest = args2
2185+
val arg1 :: args1Rest = args1: @unchecked
2186+
val arg2 :: args2Rest = args2: @unchecked
21872187
val common = singletonInterval(arg1, arg2)
21882188
val v = tparam.paramVarianceSign
21892189
val glbArg =
@@ -2921,7 +2921,7 @@ class TrackingTypeComparer(initctx: Context) extends TypeComparer(initctx) {
29212921
cas
29222922
}
29232923

2924-
val defn.MatchCase(pat, body) = cas1
2924+
val defn.MatchCase(pat, body) = cas1: @unchecked
29252925

29262926
if (isSubType(scrut, pat))
29272927
// `scrut` is a subtype of `pat`: *It's a Match!*

compiler/src/dotty/tools/dotc/core/TypeErasure.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ class TypeErasure(sourceLanguage: SourceLanguage, semiEraseVCs: Boolean, isConst
680680
}
681681

682682
private def eraseArray(tp: Type)(using Context) = {
683-
val defn.ArrayOf(elemtp) = tp
683+
val defn.ArrayOf(elemtp) = tp: @unchecked
684684
if (isGenericArrayElement(elemtp, isScala2 = sourceLanguage.isScala2)) defn.ObjectType
685685
else
686686
try JavaArrayType(erasureFn(sourceLanguage, semiEraseVCs = false, isConstructor, isSymbol, wildcardOK)(elemtp))

compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ class ClassfileParser(
283283
*/
284284
def normalizeConstructorParams() = innerClasses.get(currentClassName.toString) match {
285285
case Some(entry) if !isStatic(entry.jflags) =>
286-
val mt @ MethodTpe(paramNames, paramTypes, resultType) = denot.info
286+
val mt @ MethodTpe(paramNames, paramTypes, resultType) = denot.info: @unchecked
287287
var normalizedParamNames = paramNames.tail
288288
var normalizedParamTypes = paramTypes.tail
289289
if ((jflags & JAVA_ACC_SYNTHETIC) != 0) {

compiler/src/dotty/tools/dotc/core/tasty/TastyPickler.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class TastyPickler(val rootCls: ClassSymbol) {
4141
sections.foreach(_._2.assemble())
4242

4343
val nameBufferHash = TastyHash.pjwHash64(nameBuffer.bytes)
44-
val treeSectionHash +: otherSectionHashes = sections.map(x => TastyHash.pjwHash64(x._2.bytes))
44+
val treeSectionHash +: otherSectionHashes = sections.map(x => TastyHash.pjwHash64(x._2.bytes)): @unchecked
4545

4646
val tastyVersion = ctx.tastyVersion
4747

0 commit comments

Comments
 (0)