aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Types.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-10-26 10:29:45 +0200
committerMartin Odersky <odersky@gmail.com>2013-10-26 10:29:50 +0200
commit961c0569eb0a54cf95363bab79add43da310984c (patch)
treeefe723b1b6a182ec0f99c5f3d33b78a5a90d8bdf /src/dotty/tools/dotc/core/Types.scala
parent8c1cc60c7ef9c13b312fceaf6cb8c8c129753344 (diff)
downloaddotty-961c0569eb0a54cf95363bab79add43da310984c.tar.gz
dotty-961c0569eb0a54cf95363bab79add43da310984c.tar.bz2
dotty-961c0569eb0a54cf95363bab79add43da310984c.zip
Fixed handling of varargs
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r--src/dotty/tools/dotc/core/Types.scala10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala
index 0edb4b0cc..8b116baa5 100644
--- a/src/dotty/tools/dotc/core/Types.scala
+++ b/src/dotty/tools/dotc/core/Types.scala
@@ -171,7 +171,7 @@ object Types {
that.existsPart(this == _)
def isRepeatedParam(implicit ctx: Context): Boolean =
- defn.RepeatedParamAliases contains typeSymbol
+ defn.RepeatedParamClasses contains typeSymbol
// ----- Higher-order combinators -----------------------------------
@@ -862,6 +862,14 @@ object Types {
NoType
}
+ /** Translate a type of the form From[T] to To[T], keep other types as they are.
+ * `from` and `to` must be static classes, both with one type parameter, and the same variance.
+ */
+ def translateParameterized(from: ClassSymbol, to: ClassSymbol)(implicit ctx: Context): Type =
+ if (this derivesFrom from)
+ RefinedType(to.typeConstructor, to.typeParams.head.name, member(from.typeParams.head.name).info)
+ else this
+
/** If this is an encoding of a (partially) applied type, return its arguments,
* otherwise return Nil
*/