aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/TypeApplications.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-07-15 15:48:25 +0200
committerMartin Odersky <odersky@gmail.com>2014-08-03 17:07:10 +0200
commit0d7223ab0c61fd7d0a864f15031c34f0bb946e40 (patch)
treef6686d5e32abaa4925f4242019b628dec3907c56 /src/dotty/tools/dotc/core/TypeApplications.scala
parentef4d3f5c214c1f3a5330f4583bca2773bc2f465f (diff)
downloaddotty-0d7223ab0c61fd7d0a864f15031c34f0bb946e40.tar.gz
dotty-0d7223ab0c61fd7d0a864f15031c34f0bb946e40.tar.bz2
dotty-0d7223ab0c61fd7d0a864f15031c34f0bb946e40.zip
Fixed underlyingIfRepeated.
... and moved to TypeApplications.
Diffstat (limited to 'src/dotty/tools/dotc/core/TypeApplications.scala')
-rw-r--r--src/dotty/tools/dotc/core/TypeApplications.scala7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/TypeApplications.scala b/src/dotty/tools/dotc/core/TypeApplications.scala
index 359be171d..c63788ec9 100644
--- a/src/dotty/tools/dotc/core/TypeApplications.scala
+++ b/src/dotty/tools/dotc/core/TypeApplications.scala
@@ -284,6 +284,13 @@ class TypeApplications(val self: Type) extends AnyVal {
to.typeRef
else self
+ /** If this is repeated parameter type, its underlying Seq type,
+ * or, if isJava is true, Array type, else the type itself.
+ */
+ def underlyingIfRepeated(isJava: Boolean)(implicit ctx: Context): Type =
+ if (self.isRepeatedParam) translateParameterized(defn.RepeatedParamClass, defn.SeqClass)
+ else self
+
/** If this is an encoding of a (partially) applied type, return its arguments,
* otherwise return Nil.
* Existential types in arguments are returned as TypeBounds instances.