@@ -52,11 +52,22 @@ trait FullParameterization {
52
52
53
53
import tpd ._
54
54
55
- /** If references to original `target ` from fully parameterized method `derived` should be
56
- * rewired to some fully parameterized method, that method symbol,
55
+ /** If references to original symbol `referenced ` from within fully parameterized method
56
+ * `derived` should be rewired to some fully parameterized method, the rewiring target symbol,
57
57
* otherwise NoSymbol.
58
58
*/
59
- protected def rewiredTarget (target : Symbol , derived : Symbol )(implicit ctx : Context ): Symbol
59
+ protected def rewiredTarget (referenced : Symbol , derived : Symbol )(implicit ctx : Context ): Symbol
60
+
61
+ /** If references to some original symbol from given tree node within fully parameterized method
62
+ * `derived` should be rewired to some fully parameterized method, the rewiring target symbol,
63
+ * otherwise NoSymbol. By default implemented as
64
+ *
65
+ * rewiredTarget(tree.symbol, derived)
66
+ *
67
+ * but can be overridden.
68
+ */
69
+ protected def rewiredTarget (tree : Tree , derived : Symbol )(implicit ctx : Context ): Symbol =
70
+ rewiredTarget(tree.symbol, derived)
60
71
61
72
/** Converts the type `info` of a member of class `clazz` to a method type that
62
73
* takes the `this` of the class and any type parameters of the class
@@ -151,8 +162,7 @@ trait FullParameterization {
151
162
*/
152
163
def rewireTree (tree : Tree , targs : List [Tree ])(implicit ctx : Context ): Tree = {
153
164
def rewireCall (thisArg : Tree ): Tree = {
154
- val sym = tree.symbol
155
- val rewired = rewiredTarget(sym, derived)
165
+ val rewired = rewiredTarget(tree, derived)
156
166
if (rewired.exists) {
157
167
val base = thisArg.tpe.baseTypeWithArgs(origClass)
158
168
assert(base.exists)
0 commit comments