@@ -29,13 +29,12 @@ import EtaExpansion.etaExpand
29
29
import TypeComparer .CompareResult
30
30
import util .Spans ._
31
31
import util .common ._
32
- import util .{Property , SimpleIdentityMap , SrcPos }
32
+ import util .{Property , SimpleIdentityMap , SrcPos , Stats }
33
33
import Applications .{ExtMethodApply , IntegratedTypeArgs , productSelectorTypes , wrapDefs }
34
34
35
35
import collection .mutable
36
36
import annotation .tailrec
37
37
import Implicits ._
38
- import util .Stats .record
39
38
import config .Printers .{gadts , typr , debug }
40
39
import config .Feature ._
41
40
import config .SourceVersion ._
@@ -434,7 +433,7 @@ class Typer extends Namer
434
433
* (3) Change pattern Idents id (but not wildcards) to id @ _
435
434
*/
436
435
def typedIdent (tree : untpd.Ident , pt : Type )(using Context ): Tree =
437
- record(" typedIdent" )
436
+ Stats . record(" typedIdent" )
438
437
val name = tree.name
439
438
def kind = if (name.isTermName) " " else " type "
440
439
typr.println(s " typed ident $kind$name in ${ctx.owner}" )
@@ -551,7 +550,7 @@ class Typer extends Namer
551
550
}
552
551
553
552
def typedSelect (tree : untpd.Select , pt : Type )(using Context ): Tree = {
554
- record(" typedSelect" )
553
+ Stats . record(" typedSelect" )
555
554
556
555
def typeSelectOnTerm (using Context ): Tree =
557
556
typedSelect(tree, pt, typedExpr(tree.qualifier, selectionProto(tree.name, pt, this )))
@@ -582,7 +581,7 @@ class Typer extends Namer
582
581
}
583
582
584
583
def typedThis (tree : untpd.This )(using Context ): Tree = {
585
- record(" typedThis" )
584
+ Stats . record(" typedThis" )
586
585
assignType(tree)
587
586
}
588
587
@@ -602,7 +601,7 @@ class Typer extends Namer
602
601
def typedNumber (tree : untpd.Number , pt : Type )(using Context ): Tree = {
603
602
import scala .util .FromDigits ._
604
603
import untpd .NumberKind ._
605
- record(" typedNumber" )
604
+ Stats . record(" typedNumber" )
606
605
val digits = tree.digits
607
606
val target = pt.dealias
608
607
def lit (value : Any ) = Literal (Constant (value)).withSpan(tree.span)
@@ -2416,7 +2415,7 @@ class Typer extends Namer
2416
2415
* at the present time
2417
2416
*/
2418
2417
def typedUnadapted (initTree : untpd.Tree , pt : Type , locked : TypeVars )(using Context ): Tree = {
2419
- record(" typedUnadapted" )
2418
+ Stats . record(" typedUnadapted" )
2420
2419
val xtree = expanded(initTree)
2421
2420
xtree.removeAttachment(TypedAhead ) match {
2422
2421
case Some (ttree) => ttree
@@ -2578,8 +2577,8 @@ class Typer extends Namer
2578
2577
/** Typecheck and adapt tree, returning a typed tree. Parameters as for `typedUnadapted` */
2579
2578
def typed (tree : untpd.Tree , pt : Type , locked : TypeVars )(using Context ): Tree =
2580
2579
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" )
2583
2582
if ctx.phase.isTyper then
2584
2583
assertPositioned(tree)
2585
2584
if tree.source != ctx.source && tree.source.exists then
@@ -2715,11 +2714,11 @@ class Typer extends Namer
2715
2714
val nestedCtx = ctx.fresh.setNewTyperState()
2716
2715
val result = op(using nestedCtx)
2717
2716
if (nestedCtx.reporter.hasErrors && ! nestedCtx.reporter.hasStickyErrors) {
2718
- record(" tryEither.fallBack" )
2717
+ Stats . record(" tryEither.fallBack" )
2719
2718
fallBack(result, nestedCtx.typerState)
2720
2719
}
2721
2720
else {
2722
- record(" tryEither.commit" )
2721
+ Stats . record(" tryEither.commit" )
2723
2722
nestedCtx.typerState.commit()
2724
2723
result
2725
2724
}
@@ -2916,7 +2915,7 @@ class Typer extends Namer
2916
2915
def adapt (tree : Tree , pt : Type , locked : TypeVars , tryGadtHealing : Boolean = true )(using Context ): Tree =
2917
2916
try
2918
2917
trace(i " adapting $tree to $pt ${if (tryGadtHealing) " " else " (tryGadtHealing=false)" }\n " , typr, show = true ) {
2919
- record(" adapt" )
2918
+ Stats . record(" adapt" )
2920
2919
adapt1(tree, pt, locked, tryGadtHealing)
2921
2920
}
2922
2921
catch case ex : TypeError => errorTree(tree, ex, tree.srcPos.focus)
0 commit comments