Skip to content

Commit 95a71de

Browse files
committed
Rename PolyType.copy method. It clashes with generated one.
See #209 for explanation.
1 parent b90f530 commit 95a71de

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
@@ -1999,9 +1999,9 @@ object Types {
19991999

20002000
def derivedPolyType(paramNames: List[TypeName], paramBounds: List[TypeBounds], restpe: Type)(implicit ctx: Context) =
20012001
if ((paramNames eq this.paramNames) && (paramBounds eq this.paramBounds) && (restpe eq this.resultType)) this
2002-
else copy(paramNames, paramBounds, restpe)
2002+
else duplicate(paramNames, paramBounds, restpe)
20032003

2004-
def copy(paramNames: List[TypeName] = this.paramNames, paramBounds: List[TypeBounds] = this.paramBounds, restpe: Type)(implicit ctx: Context) =
2004+
def duplicate(paramNames: List[TypeName] = this.paramNames, paramBounds: List[TypeBounds] = this.paramBounds, restpe: Type)(implicit ctx: Context) =
20052005
PolyType(paramNames)(
20062006
x => paramBounds mapConserve (_.subst(this, x).bounds),
20072007
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)