@@ -29,13 +29,12 @@ import EtaExpansion.etaExpand
2929import TypeComparer .CompareResult
3030import util .Spans ._
3131import util .common ._
32- import util .{Property , SimpleIdentityMap , SrcPos }
32+ import util .{Property , SimpleIdentityMap , SrcPos , Stats }
3333import Applications .{ExtMethodApply , IntegratedTypeArgs , productSelectorTypes , wrapDefs }
3434
3535import collection .mutable
3636import annotation .tailrec
3737import Implicits ._
38- import util .Stats .record
3938import config .Printers .{gadts , typr , debug }
4039import config .Feature ._
4140import config .SourceVersion ._
@@ -434,7 +433,7 @@ class Typer extends Namer
434433 * (3) Change pattern Idents id (but not wildcards) to id @ _
435434 */
436435 def typedIdent (tree : untpd.Ident , pt : Type )(using Context ): Tree =
437- record(" typedIdent" )
436+ Stats . record(" typedIdent" )
438437 val name = tree.name
439438 def kind = if (name.isTermName) " " else " type "
440439 typr.println(s " typed ident $kind$name in ${ctx.owner}" )
@@ -551,7 +550,7 @@ class Typer extends Namer
551550 }
552551
553552 def typedSelect (tree : untpd.Select , pt : Type )(using Context ): Tree = {
554- record(" typedSelect" )
553+ Stats . record(" typedSelect" )
555554
556555 def typeSelectOnTerm (using Context ): Tree =
557556 typedSelect(tree, pt, typedExpr(tree.qualifier, selectionProto(tree.name, pt, this )))
@@ -582,7 +581,7 @@ class Typer extends Namer
582581 }
583582
584583 def typedThis (tree : untpd.This )(using Context ): Tree = {
585- record(" typedThis" )
584+ Stats . record(" typedThis" )
586585 assignType(tree)
587586 }
588587
@@ -602,7 +601,7 @@ class Typer extends Namer
602601 def typedNumber (tree : untpd.Number , pt : Type )(using Context ): Tree = {
603602 import scala .util .FromDigits ._
604603 import untpd .NumberKind ._
605- record(" typedNumber" )
604+ Stats . record(" typedNumber" )
606605 val digits = tree.digits
607606 val target = pt.dealias
608607 def lit (value : Any ) = Literal (Constant (value)).withSpan(tree.span)
@@ -2416,7 +2415,7 @@ class Typer extends Namer
24162415 * at the present time
24172416 */
24182417 def typedUnadapted (initTree : untpd.Tree , pt : Type , locked : TypeVars )(using Context ): Tree = {
2419- record(" typedUnadapted" )
2418+ Stats . record(" typedUnadapted" )
24202419 val xtree = expanded(initTree)
24212420 xtree.removeAttachment(TypedAhead ) match {
24222421 case Some (ttree) => ttree
@@ -2578,8 +2577,8 @@ class Typer extends Namer
25782577 /** Typecheck and adapt tree, returning a typed tree. Parameters as for `typedUnadapted` */
25792578 def typed (tree : untpd.Tree , pt : Type , locked : TypeVars )(using Context ): Tree =
25802579 trace(i " typing $tree, pt = $pt" , typr, show = true ) {
2581- record(s " typed $getClass" )
2582- record(" typed total" )
2580+ Stats . record(s " typed $getClass" )
2581+ Stats . record(" typed total" )
25832582 if ctx.phase.isTyper then
25842583 assertPositioned(tree)
25852584 if tree.source != ctx.source && tree.source.exists then
@@ -2715,11 +2714,11 @@ class Typer extends Namer
27152714 val nestedCtx = ctx.fresh.setNewTyperState()
27162715 val result = op(using nestedCtx)
27172716 if (nestedCtx.reporter.hasErrors && ! nestedCtx.reporter.hasStickyErrors) {
2718- record(" tryEither.fallBack" )
2717+ Stats . record(" tryEither.fallBack" )
27192718 fallBack(result, nestedCtx.typerState)
27202719 }
27212720 else {
2722- record(" tryEither.commit" )
2721+ Stats . record(" tryEither.commit" )
27232722 nestedCtx.typerState.commit()
27242723 result
27252724 }
@@ -2916,7 +2915,7 @@ class Typer extends Namer
29162915 def adapt (tree : Tree , pt : Type , locked : TypeVars , tryGadtHealing : Boolean = true )(using Context ): Tree =
29172916 try
29182917 trace(i " adapting $tree to $pt ${if (tryGadtHealing) " " else " (tryGadtHealing=false)" }\n " , typr, show = true ) {
2919- record(" adapt" )
2918+ Stats . record(" adapt" )
29202919 adapt1(tree, pt, locked, tryGadtHealing)
29212920 }
29222921 catch case ex : TypeError => errorTree(tree, ex, tree.srcPos.focus)
0 commit comments