File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -350,7 +350,10 @@ trait TypeAssigner {
350350 else {
351351 // Make sure arguments don't contain the type `pt` itself.
352352 // make a copy of the argument if that's the case.
353- // See pos/i6682a.scala for a test case where this matters.
353+ // This is done to compensate for the fact that normally every
354+ // reference to a polytype would have to be a fresh copy of that type,
355+ // but we want to avoid that because it would increase compilation cost.
356+ // See pos/i6682a.scala for a test case where the defensive copying matters.
354357 val ensureFresh = new TypeMap :
355358 def apply (tp : Type ) = mapOver(
356359 if tp eq pt then pt.newLikeThis(pt.paramNames, pt.paramInfos, pt.resType)
You can’t perform that action at this time.
0 commit comments