Skip to content

Commit 5a15ee9

Browse files
committed
Rename PolyType.copy method. It clashes with generated one.
See scala#209 for explanation.
1 parent a273c3f commit 5a15ee9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/dotty/tools/dotc/core/Types.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2033,9 +2033,9 @@ object Types {
20332033

20342034
def derivedPolyType(paramNames: List[TypeName], paramBounds: List[TypeBounds], restpe: Type)(implicit ctx: Context) =
20352035
if ((paramNames eq this.paramNames) && (paramBounds eq this.paramBounds) && (restpe eq this.resultType)) this
2036-
else copy(paramNames, paramBounds, restpe)
2036+
else duplicate(paramNames, paramBounds, restpe)
20372037

2038-
def copy(paramNames: List[TypeName] = this.paramNames, paramBounds: List[TypeBounds] = this.paramBounds, restpe: Type)(implicit ctx: Context) =
2038+
def duplicate(paramNames: List[TypeName] = this.paramNames, paramBounds: List[TypeBounds] = this.paramBounds, restpe: Type)(implicit ctx: Context) =
20392039
PolyType(paramNames)(
20402040
x => paramBounds mapConserve (_.subst(this, x).bounds),
20412041
x => restpe.subst(this, x))

src/dotty/tools/dotc/typer/ProtoTypes.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ object ProtoTypes {
321321
yield new TypeVar(PolyParam(pt, n), state, owningTree)
322322

323323
val added =
324-
if (state.constraint contains pt) pt.copy(pt.paramNames, pt.paramBounds, pt.resultType)
324+
if (state.constraint contains pt) pt.duplicate(pt.paramNames, pt.paramBounds, pt.resultType)
325325
else pt
326326
val tvars = if (owningTree.isEmpty) Nil else newTypeVars(added)
327327
state.constraint = state.constraint.add(added, tvars)

0 commit comments

Comments
 (0)