Skip to content

Commit ccde63f

Browse files
committed
Avoid asInstanceOf in logging
1 parent ee73e8d commit ccde63f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/transform/init/Semantic.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ object Semantic {
542542
}
543543
}
544544

545-
def callConstructor(ctor: Symbol, args: List[ArgInfo], source: Tree): Contextual[Result] = log("call " + ctor.show + ", args = " + args, printer, res => res.asInstanceOf[Result].show) {
545+
def callConstructor(ctor: Symbol, args: List[ArgInfo], source: Tree): Contextual[Result] = log("call " + ctor.show + ", args = " + args, printer, (_: Result).show) {
546546
value match {
547547
case Hot | Cold | _: RefSet | _: Fun =>
548548
report.error("unexpected constructor call, meth = " + ctor + ", value = " + value, source)
@@ -1421,7 +1421,7 @@ object Semantic {
14211421
extension (symbol: Symbol) def hasSource(using Context): Boolean =
14221422
!symbol.defTree.isEmpty
14231423

1424-
def resolve(cls: ClassSymbol, sym: Symbol)(using Context): Symbol = log("resove " + cls + ", " + sym, printer, _.asInstanceOf[Symbol].show) {
1424+
def resolve(cls: ClassSymbol, sym: Symbol)(using Context): Symbol = log("resove " + cls + ", " + sym, printer, (_: Symbol).show) {
14251425
if (sym.isEffectivelyFinal || sym.isConstructor) sym
14261426
else sym.matchingMember(cls.appliedRef)
14271427
}

0 commit comments

Comments
 (0)