@@ -321,7 +321,7 @@ class Semantic {
321
321
def widenArgs : List [Value ] = values.map(_.widenArg).toList
322
322
323
323
extension (value : Value )
324
- def select (field : Symbol , source : Tree , needResolve : Boolean = true ): Contextual [Result ] = log(" select " + field.show, printer, res => res. asInstanceOf [ Result ] .show) {
324
+ def select (field : Symbol , source : Tree , needResolve : Boolean = true ): Contextual [Result ] = log(" select " + field.show, printer, ( _ : Result ) .show) {
325
325
if promoted.isCurrentObjectPromoted then Result (Hot , Nil )
326
326
else value match {
327
327
case Hot =>
@@ -371,7 +371,7 @@ class Semantic {
371
371
}
372
372
}
373
373
374
- def call (meth : Symbol , args : List [ArgInfo ], superType : Type , source : Tree , needResolve : Boolean = true ): Contextual [Result ] = log(" call " + meth.show + " , args = " + args, printer, res => res. asInstanceOf [ Result ] .show) {
374
+ def call (meth : Symbol , args : List [ArgInfo ], superType : Type , source : Tree , needResolve : Boolean = true ): Contextual [Result ] = log(" call " + meth.show + " , args = " + args, printer, ( _ : Result ) .show) {
375
375
def checkArgs = args.flatMap(_.promote)
376
376
377
377
// fast track if the current object is already initialized
@@ -445,7 +445,7 @@ class Semantic {
445
445
}
446
446
447
447
/** Handle a new expression `new p.C` where `p` is abstracted by `value` */
448
- def instantiate (klass : ClassSymbol , ctor : Symbol , args : List [ArgInfo ], source : Tree ): Contextual [Result ] = log(" instantiating " + klass.show + " , value = " + value + " , args = " + args, printer, res => res. asInstanceOf [ Result ] .show) {
448
+ def instantiate (klass : ClassSymbol , ctor : Symbol , args : List [ArgInfo ], source : Tree ): Contextual [Result ] = log(" instantiating " + klass.show + " , value = " + value + " , args = " + args, printer, ( _ : Result ) .show) {
449
449
val trace1 = trace.add(source)
450
450
if promoted.isCurrentObjectPromoted then Result (Hot , Nil )
451
451
else value match {
@@ -702,7 +702,7 @@ class Semantic {
702
702
*
703
703
* This method only handles cache logic and delegates the work to `cases`.
704
704
*/
705
- def eval (expr : Tree , thisV : Addr , klass : ClassSymbol , cacheResult : Boolean = false ): Contextual [Result ] = log(" evaluating " + expr.show + " , this = " + thisV.show, printer, res => res. asInstanceOf [ Result ] .show) {
705
+ def eval (expr : Tree , thisV : Addr , klass : ClassSymbol , cacheResult : Boolean = false ): Contextual [Result ] = log(" evaluating " + expr.show + " , this = " + thisV.show, printer, ( _ : Result ) .show) {
706
706
val innerMap = cache.getOrElseUpdate(thisV, new EqHashMap [Tree , Value ])
707
707
if (innerMap.contains(expr)) Result (innerMap(expr), Errors .empty)
708
708
else {
@@ -911,7 +911,7 @@ class Semantic {
911
911
}
912
912
913
913
/** Handle semantics of leaf nodes */
914
- def cases (tp : Type , thisV : Addr , klass : ClassSymbol , source : Tree ): Contextual [Result ] = log(" evaluating " + tp.show, printer, res => res. asInstanceOf [ Result ] .show) {
914
+ def cases (tp : Type , thisV : Addr , klass : ClassSymbol , source : Tree ): Contextual [Result ] = log(" evaluating " + tp.show, printer, ( _ : Result ) .show) {
915
915
tp match {
916
916
case _ : ConstantType =>
917
917
Result (Hot , Errors .empty)
@@ -941,7 +941,7 @@ class Semantic {
941
941
}
942
942
943
943
/** Resolve C.this that appear in `klass` */
944
- def resolveThis (target : ClassSymbol , thisV : Value , klass : ClassSymbol , source : Tree ): Contextual [Value ] = log(" resolving " + target.show + " , this = " + thisV.show + " in " + klass.show, printer, res => res. asInstanceOf [ Value ] .show) {
944
+ def resolveThis (target : ClassSymbol , thisV : Value , klass : ClassSymbol , source : Tree ): Contextual [Value ] = log(" resolving " + target.show + " , this = " + thisV.show + " in " + klass.show, printer, ( _ : Value ) .show) {
945
945
if target == klass then thisV
946
946
else if target.is(Flags .Package ) then Hot
947
947
else
@@ -969,7 +969,7 @@ class Semantic {
969
969
*
970
970
* See `tpd.outerSelect` and `ElimOuterSelect`.
971
971
*/
972
- def resolveOuterSelect (target : ClassSymbol , thisV : Value , hops : Int , source : Tree ): Contextual [Value ] = log(" resolving outer " + target.show + " , this = " + thisV.show + " , hops = " + hops, printer, res => res. asInstanceOf [ Value ] .show) {
972
+ def resolveOuterSelect (target : ClassSymbol , thisV : Value , hops : Int , source : Tree ): Contextual [Value ] = log(" resolving outer " + target.show + " , this = " + thisV.show + " , hops = " + hops, printer, ( _ : Value ) .show) {
973
973
// Is `target` reachable from `cls` with the given `hops`?
974
974
def reachable (cls : ClassSymbol , hops : Int ): Boolean =
975
975
if hops == 0 then cls == target
@@ -1011,7 +1011,7 @@ class Semantic {
1011
1011
else cases(tref.prefix, thisV, klass, source)
1012
1012
1013
1013
/** Initialize part of an abstract object in `klass` of the inheritance chain */
1014
- def init (tpl : Template , thisV : Addr , klass : ClassSymbol ): Contextual [Result ] = log(" init " + klass.show, printer, res => res. asInstanceOf [ Result ] .show) {
1014
+ def init (tpl : Template , thisV : Addr , klass : ClassSymbol ): Contextual [Result ] = log(" init " + klass.show, printer, ( _ : Result ) .show) {
1015
1015
val errorBuffer = new mutable.ArrayBuffer [Error ]
1016
1016
1017
1017
val paramsMap = tpl.constr.termParamss.flatten.map { vdef =>
0 commit comments