Skip to content

Commit ab42a3c

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 15fad98 commit ab42a3c

File tree

76 files changed

+156
-155
lines changed

Some content is hidden

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

76 files changed

+156
-155
lines changed

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

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

362-
val DesugaredSelect(prefix, _) = fun
362+
val DesugaredSelect(prefix, _) = fun: @unchecked
363363
genLoad(prefix)
364364
}
365365

@@ -725,7 +725,7 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
725725
lineNumber(app)
726726
app match {
727727
case Apply(_, args) if app.symbol eq defn.newArrayMethod =>
728-
val List(elemClaz, Literal(c: Constant), ArrayValue(_, dims)) = args
728+
val List(elemClaz, Literal(c: Constant), ArrayValue(_, dims)) = args: @unchecked
729729

730730
generatedType = toTypeKind(c.typeValue)
731731
mkArrayConstructorCall(generatedType.asArrayBType, app, dims)
@@ -802,7 +802,7 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
802802
if (invokeStyle.hasInstance) genLoadQualifier(fun)
803803
genLoadArguments(args, paramTKs(app))
804804

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

847847
private def genArrayValue(av: tpd.JavaSeqLiteral): BType = {
848-
val ArrayValue(tpt, elems) = av
848+
val ArrayValue(tpt, elems) = av: @unchecked
849849

850850
lineNumber(av)
851851
genArray(elems, tpt)
@@ -1530,7 +1530,7 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
15301530
import ScalaPrimitivesOps.{ ZNOT, ZAND, ZOR, EQ }
15311531

15321532
// lhs and rhs of test
1533-
lazy val DesugaredSelect(lhs, _) = fun
1533+
lazy val DesugaredSelect(lhs, _) = fun: @unchecked
15341534
val rhs = if (args.isEmpty) tpd.EmptyTree else args.head // args.isEmpty only for ZNOT
15351535

15361536
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
@@ -689,7 +689,7 @@ trait BCodeSkelBuilder extends BCodeHelpers {
689689
val origSym = dd.symbol.asTerm
690690
val newSym = makeStatifiedDefSymbol(origSym, origSym.name)
691691
tpd.DefDef(newSym, { paramRefss =>
692-
val selfParamRef :: regularParamRefs = paramRefss.head
692+
val selfParamRef :: regularParamRefs = paramRefss.head: @unchecked
693693
val enclosingClass = origSym.owner.asClass
694694
new TreeTypeMap(
695695
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
@@ -405,7 +405,7 @@ object desugar {
405405

406406
/** The expansion of a class definition. See inline comments for what is involved */
407407
def classDef(cdef: TypeDef)(using Context): Tree = {
408-
val impl @ Template(constr0, _, self, _) = cdef.rhs
408+
val impl @ Template(constr0, _, self, _) = cdef.rhs: @unchecked
409409
val className = normalizeName(cdef, impl).asTypeName
410410
val parents = impl.parents
411411
val mods = cdef.mods
@@ -695,7 +695,7 @@ object desugar {
695695
.withMods(companionMods | Synthetic))
696696
.withSpan(cdef.span).toList
697697
if (companionDerived.nonEmpty)
698-
for (modClsDef @ TypeDef(_, _) <- mdefs)
698+
for (case modClsDef @ TypeDef(_, _) <- mdefs)
699699
modClsDef.putAttachment(DerivingCompanion, impl.srcPos.startPos)
700700
mdefs
701701
}
@@ -753,7 +753,7 @@ object desugar {
753753

754754
enumCompanionRef match {
755755
case ref: TermRefTree => // have the enum import watch the companion object
756-
val (modVal: ValDef) :: _ = companions
756+
val (modVal: ValDef) :: _ = companions: @unchecked
757757
ref.watching(modVal)
758758
case _ =>
759759
}
@@ -1215,7 +1215,7 @@ object desugar {
12151215

12161216
/** Expand variable identifier x to x @ _ */
12171217
def patternVar(tree: Tree)(using Context): Bind = {
1218-
val Ident(name) = unsplice(tree)
1218+
val Ident(name) = unsplice(tree): @unchecked
12191219
Bind(name, Ident(nme.WILDCARD)).withSpan(tree.span)
12201220
}
12211221

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
@@ -956,7 +956,7 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
956956
Some(tree.args.head)
957957
else if tree.symbol == defn.QuotedTypeModule_of then
958958
// quoted.Type.of[<body>](quotes)
959-
val TypeApply(_, body :: _) = tree.fun
959+
val TypeApply(_, body :: _) = tree.fun: @unchecked
960960
Some(body)
961961
else None
962962
}

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

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

157157
private def transformAllParamss(paramss: List[ParamClause]): (TreeTypeMap, List[ParamClause]) = paramss match
158158
case params :: paramss1 =>
159-
val (tmap1, params1: ParamClause) = (params: @unchecked) match
159+
val (tmap1, params1: ParamClause) = ((params: @unchecked) match
160160
case ValDefs(vparams) => transformDefs(vparams)
161161
case TypeDefs(tparams) => transformDefs(tparams)
162+
): @unchecked
162163
val (tmap2, paramss2) = tmap1.transformAllParamss(paramss1)
163164
(tmap2, params1 :: paramss2)
164165
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
@@ -269,7 +269,7 @@ trait ConstraintHandling {
269269
(c1 eq constraint)
270270
|| {
271271
constraint = c1
272-
val TypeBounds(lo, hi) = constraint.entry(param)
272+
val TypeBounds(lo, hi) = constraint.entry(param): @unchecked
273273
isSub(lo, hi)
274274
}
275275
end addOneBound
@@ -368,7 +368,7 @@ trait ConstraintHandling {
368368

369369
if level1 != level2 then
370370
boundRemoved = LevelAvoidMap(-1, math.min(level1, level2))(boundRemoved)
371-
val TypeBounds(lo, hi) = boundRemoved
371+
val TypeBounds(lo, hi) = boundRemoved: @unchecked
372372
// After avoidance, the interval might be empty, e.g. in
373373
// tests/pos/i8900-promote.scala:
374374
// >: x.type <: Singleton
@@ -416,7 +416,7 @@ trait ConstraintHandling {
416416
*/
417417
protected final def isSatisfiable(using Context): Boolean =
418418
constraint.forallParams { param =>
419-
val TypeBounds(lo, hi) = constraint.entry(param)
419+
val TypeBounds(lo, hi) = constraint.entry(param): @unchecked
420420
isSub(lo, hi) || {
421421
report.log(i"sub fail $lo <:< $hi")
422422
false

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ class OrderingConstraint(private val boundsMap: ParamBounds,
518518
if (tl.isInstanceOf[HKLambda]) {
519519
// HKLambdas are hash-consed, need to create an artificial difference by adding
520520
// a LazyRef to a bound.
521-
val TypeBounds(lo, hi) :: pinfos1 = tl.paramInfos
521+
val TypeBounds(lo, hi) :: pinfos1 = tl.paramInfos: @unchecked
522522
paramInfos = TypeBounds(lo, LazyRef.of(hi)) :: pinfos1
523523
}
524524
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)