aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/TypeApplications.scala
diff options
context:
space:
mode:
authorDmitry Petrashko <dmitry.petrashko@gmail.com>2014-10-29 17:26:13 +0100
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2014-11-22 20:10:19 +0100
commitcbe4f0a44739a26cfddc45bea33fee6246a240f5 (patch)
tree42f19ab80633e7988a63d78a040c7e0f110e202c /src/dotty/tools/dotc/core/TypeApplications.scala
parent9bcb3a0bf17352efa22bd50c5d8738b79eeae72c (diff)
downloaddotty-cbe4f0a44739a26cfddc45bea33fee6246a240f5.tar.gz
dotty-cbe4f0a44739a26cfddc45bea33fee6246a240f5.tar.bz2
dotty-cbe4f0a44739a26cfddc45bea33fee6246a240f5.zip
Fix underlyingIfRepeated always assuming Scala repeated.
Diffstat (limited to 'src/dotty/tools/dotc/core/TypeApplications.scala')
-rw-r--r--src/dotty/tools/dotc/core/TypeApplications.scala7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/core/TypeApplications.scala b/src/dotty/tools/dotc/core/TypeApplications.scala
index bf756facf..3808cb17c 100644
--- a/src/dotty/tools/dotc/core/TypeApplications.scala
+++ b/src/dotty/tools/dotc/core/TypeApplications.scala
@@ -283,9 +283,12 @@ class TypeApplications(val self: Type) extends AnyVal {
/** 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)
+ def underlyingIfRepeated(isJava: Boolean)(implicit ctx: Context): Type = {
+ if (self.isRepeatedParam)
+ if (isJava) translateParameterized(defn.RepeatedParamClass, defn.ArrayClass)
+ else translateParameterized(defn.RepeatedParamClass, defn.SeqClass)
else self
+ }
/** If this is an encoding of a (partially) applied type, return its arguments,
* otherwise return Nil.