Skip to content

Commit 1957093

Browse files
committed
Addressing review comments of #336
1 parent 3f7b5d2 commit 1957093

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/dotty/tools/dotc/transform/FullParameterization.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ trait FullParameterization {
150150
* fully parameterized method definition derived from `originalDef`, which
151151
* has `derived` as symbol and `fullyParameterizedType(originalDef.symbol.info)`
152152
* as info.
153+
* `abstractOverClass` defines weather the DefDef should abstract over type parameters
154+
* of class that contained original defDef
153155
*/
154156
def fullyParameterizedDef(derived: TermSymbol, originalDef: DefDef, abstractOverClass: Boolean = true)(implicit ctx: Context): Tree =
155157
polyDefDef(derived, trefs => vrefss => {
@@ -216,7 +218,7 @@ trait FullParameterization {
216218
})
217219

218220
/** A forwarder expression which calls `derived`, passing along
219-
* - the type parameters and enclosing class parameters of `originalDef`,
221+
* - if `abstractOverClass` the type parameters and enclosing class parameters of originalDef`,
220222
* - the `this` of the enclosing class,
221223
* - the value parameters of the original method `originalDef`.
222224
*/

tests/pos/tailcall/i321.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import scala.annotation.tailrec
33
* Illustrates that abstracting over type arguments without triggering Ycheck failure is tricky
44
*
55
* go1.loop refers to type parameter of i321, and captures value f
6-
* if goo1.loop will abstract over T it will need to cast f or will trigger a Ycheck failure.
6+
* if go1.loop will abstract over T it will need to cast f or will trigger a Ycheck failure.
77
* One could decide to not abstract over type parameters in tail calls, but this leads us to go2 example
88
*
99
* In go2 we should abstract over i321.T, as we need to change it in recursive call.

0 commit comments

Comments
 (0)