diff options
author | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2014-11-03 13:51:57 +0100 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2014-11-22 20:10:20 +0100 |
commit | 5a15ee9fde347787227a3fa8e31e17f32fd8a5bb (patch) | |
tree | 3cd0be2029a2d43c837a284c8987229cfa365ac1 /src | |
parent | a273c3f33a46b31be629cdbb60f4736642a420be (diff) | |
download | dotty-5a15ee9fde347787227a3fa8e31e17f32fd8a5bb.tar.gz dotty-5a15ee9fde347787227a3fa8e31e17f32fd8a5bb.tar.bz2 dotty-5a15ee9fde347787227a3fa8e31e17f32fd8a5bb.zip |
Rename PolyType.copy method. It clashes with generated one.
See #209 for explanation.
Diffstat (limited to 'src')
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 4 | ||||
-rw-r--r-- | src/dotty/tools/dotc/typer/ProtoTypes.scala | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index b4603a34a..601870e55 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -2033,9 +2033,9 @@ object Types { def derivedPolyType(paramNames: List[TypeName], paramBounds: List[TypeBounds], restpe: Type)(implicit ctx: Context) = if ((paramNames eq this.paramNames) && (paramBounds eq this.paramBounds) && (restpe eq this.resultType)) this - else copy(paramNames, paramBounds, restpe) + else duplicate(paramNames, paramBounds, restpe) - def copy(paramNames: List[TypeName] = this.paramNames, paramBounds: List[TypeBounds] = this.paramBounds, restpe: Type)(implicit ctx: Context) = + def duplicate(paramNames: List[TypeName] = this.paramNames, paramBounds: List[TypeBounds] = this.paramBounds, restpe: Type)(implicit ctx: Context) = PolyType(paramNames)( x => paramBounds mapConserve (_.subst(this, x).bounds), x => restpe.subst(this, x)) diff --git a/src/dotty/tools/dotc/typer/ProtoTypes.scala b/src/dotty/tools/dotc/typer/ProtoTypes.scala index 917c195fd..8d29916fa 100644 --- a/src/dotty/tools/dotc/typer/ProtoTypes.scala +++ b/src/dotty/tools/dotc/typer/ProtoTypes.scala @@ -321,7 +321,7 @@ object ProtoTypes { yield new TypeVar(PolyParam(pt, n), state, owningTree) val added = - if (state.constraint contains pt) pt.copy(pt.paramNames, pt.paramBounds, pt.resultType) + if (state.constraint contains pt) pt.duplicate(pt.paramNames, pt.paramBounds, pt.resultType) else pt val tvars = if (owningTree.isEmpty) Nil else newTypeVars(added) state.constraint = state.constraint.add(added, tvars) |