@@ -1800,16 +1800,17 @@ class Typer extends Namer
1800
1800
typed(ifun, pt)
1801
1801
}
1802
1802
1803
- def typed (tree : untpd.Tree , pt : Type = WildcardType )(implicit ctx : Context ): Tree = /* >|>*/ trace(i " typing $tree" , typr, show = true ) /* <|<*/ {
1804
- record(s " typed $getClass" )
1805
- record(" typed total" )
1806
- assertPositioned(tree)
1807
- try adapt(typedUnadapted(tree, pt), pt)
1808
- catch {
1809
- case ex : CyclicReference => errorTree(tree, cyclicErrorMsg(ex))
1810
- case ex : TypeError => errorTree(tree, ex.getMessage)
1803
+ def typed (tree : untpd.Tree , pt : Type = WildcardType )(implicit ctx : Context ): Tree =
1804
+ trace(i " typing $tree" , typr, show = true ) {
1805
+ record(s " typed $getClass" )
1806
+ record(" typed total" )
1807
+ assertPositioned(tree)
1808
+ try adapt(typedUnadapted(tree, pt), pt)
1809
+ catch {
1810
+ case ex : CyclicReference => errorTree(tree, cyclicErrorMsg(ex))
1811
+ case ex : TypeError => errorTree(tree, ex.getMessage)
1812
+ }
1811
1813
}
1812
- }
1813
1814
1814
1815
def typedTrees (trees : List [untpd.Tree ])(implicit ctx : Context ): List [Tree ] =
1815
1816
trees mapconserve (typed(_))
@@ -1977,7 +1978,11 @@ class Typer extends Namer
1977
1978
}
1978
1979
1979
1980
def adapt (tree : Tree , pt : Type )(implicit ctx : Context ): Tree = /* >|>*/ track(" adapt" ) /* <|<*/ {
1980
- /* >|>*/ trace(i " adapting $tree of type ${tree.tpe} to $pt" , typr, show = true ) /* <|<*/ {
1981
+ def showWithType (x : Any ) = x match {
1982
+ case tree : tpd.Tree @ unchecked => i " $tree of type ${tree.tpe}"
1983
+ case _ => String .valueOf(x)
1984
+ }
1985
+ /* >|>*/ trace(i " adapting $tree of type ${tree.tpe} to $pt" , typr, showOp = showWithType) /* <|<*/ {
1981
1986
if (! tree.denot.isOverloaded) {
1982
1987
// for overloaded trees: resolve overloading before simplifying
1983
1988
if (tree.isDef) interpolateUndetVars(tree, tree.symbol, pt)
0 commit comments