Skip to content

Commit 31c751f

Browse files
committed
Fix unchecked warnings in compiler
1 parent 10169b1 commit 31c751f

File tree

7 files changed

+76
-76
lines changed

7 files changed

+76
-76
lines changed

compiler/src/dotty/tools/dotc/interactive/Completion.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ object Completion {
8989
completionPrefix(selector :: Nil, pos)
9090
}.getOrElse("")
9191

92-
case (ref: RefTree) :: _ =>
92+
case (ref: untpd.RefTree) :: _ =>
9393
if (ref.name == nme.ERROR) ""
9494
else ref.name.toString.take(pos.span.point - ref.span.point)
9595

compiler/src/dotty/tools/dotc/tastyreflect/ReflectionCompilerInterface.scala

Lines changed: 67 additions & 67 deletions
Large diffs are not rendered by default.

compiler/src/dotty/tools/dotc/transform/Erasure.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@ object Erasure {
907907
*/
908908
private def addRetainedInlineBodies(stats: List[untpd.Tree])(using Context): List[untpd.Tree] =
909909
lazy val retainerDef: Map[Symbol, DefDef] = stats.collect {
910-
case stat: DefDef if stat.symbol.name.is(BodyRetainerName) =>
910+
case stat: DefDef @unchecked if stat.symbol.name.is(BodyRetainerName) =>
911911
val retainer = stat.symbol
912912
val origName = retainer.name.asTermName.exclude(BodyRetainerName)
913913
val inlineMeth = ctx.atPhase(ctx.typerPhase) {
@@ -918,7 +918,7 @@ object Erasure {
918918
(inlineMeth, stat)
919919
}.toMap
920920
stats.mapConserve {
921-
case stat: DefDef if stat.symbol.isRetainedInlineMethod =>
921+
case stat: DefDef @unchecked if stat.symbol.isRetainedInlineMethod =>
922922
val rdef = retainerDef(stat.symbol)
923923
val fromParams = untpd.allParamSyms(rdef)
924924
val toParams = untpd.allParamSyms(stat)

compiler/src/dotty/tools/dotc/transform/TreeChecker.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ class TreeChecker extends Phase with SymTransformer {
455455

456456
override def typedClosure(tree: untpd.Closure, pt: Type)(using Context): Tree = {
457457
if (!ctx.phase.lambdaLifted) nestingBlock match {
458-
case block @ Block((meth : DefDef) :: Nil, closure: Closure) =>
458+
case block @ Block((meth : untpd.DefDef) :: Nil, closure: untpd.Closure) =>
459459
assert(meth.symbol == closure.meth.symbol, "closure.meth symbol not equal to method symbol. Block: " + block.show)
460460

461461
case block: untpd.Block =>

compiler/src/dotty/tools/dotc/typer/Applications.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -910,8 +910,8 @@ trait Applications extends Compatibility {
910910
tree.args match {
911911
case (arg @ Match(EmptyTree, cases)) :: Nil =>
912912
cases.foreach {
913-
case CaseDef(Typed(_: Ident, _), _, _) => // OK
914-
case CaseDef(Bind(_, Typed(_: Ident, _)), _, _) => // OK
913+
case CaseDef(Typed(_: untpd.Ident, _), _, _) => // OK
914+
case CaseDef(Bind(_, Typed(_: untpd.Ident, _)), _, _) => // OK
915915
case CaseDef(Ident(name), _, _) if name == nme.WILDCARD => // Ok
916916
case CaseDef(pat, _, _) =>
917917
ctx.error(UnexpectedPatternForSummonFrom(pat), pat.sourcePos)

compiler/src/dotty/tools/dotc/typer/Nullables.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,8 +489,8 @@ object Nullables:
489489

490490
object retyper extends ReTyper:
491491
override def typedUnadapted(t: untpd.Tree, pt: Type, locked: TypeVars)(using Context): Tree = t match
492-
case t: ValDef if !t.symbol.is(Lazy) => super.typedUnadapted(t, pt, locked)
493-
case t: MemberDef => promote(t)
492+
case t: untpd.ValDef if !t.symbol.is(Lazy) => super.typedUnadapted(t, pt, locked)
493+
case t: untpd.MemberDef => promote(t)
494494
case _ => super.typedUnadapted(t, pt, locked)
495495

496496
def postProcess(formal: Type, arg: Tree): Tree =

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1264,7 +1264,7 @@ class Typer extends Namer
12641264
.map(cas => untpd.unbind(untpd.unsplice(cas.pat)))
12651265
.zip(mt.cases)
12661266
.forall {
1267-
case (pat: Typed, pt) =>
1267+
case (pat: untpd.Typed, pt) =>
12681268
// To check that pattern types correspond we need to type
12691269
// check `pat` here and throw away the result.
12701270
val gadtCtx: Context = ctx.fresh.setFreshGADTBounds

0 commit comments

Comments
 (0)