diff options
author | Ondrej Lhotak <olhotak@uwaterloo.ca> | 2014-10-08 11:49:19 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2014-11-22 20:10:20 +0100 |
commit | ade0565fcdf6cb95818f538a95f798c7456d4c72 (patch) | |
tree | e7fc8e5a372c91516d06400e7b41981714a4d143 /src/dotty/tools/dotc/core/TypeApplications.scala | |
parent | 03627e71d9fdc4b2211d244cc8fd844d57997357 (diff) | |
download | dotty-ade0565fcdf6cb95818f538a95f798c7456d4c72.tar.gz dotty-ade0565fcdf6cb95818f538a95f798c7456d4c72.tar.bz2 dotty-ade0565fcdf6cb95818f538a95f798c7456d4c72.zip |
desugar Java repeated parms into an Array instead of Seq
Diffstat (limited to 'src/dotty/tools/dotc/core/TypeApplications.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/TypeApplications.scala | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/dotty/tools/dotc/core/TypeApplications.scala b/src/dotty/tools/dotc/core/TypeApplications.scala index 3808cb17c..3beb680d9 100644 --- a/src/dotty/tools/dotc/core/TypeApplications.scala +++ b/src/dotty/tools/dotc/core/TypeApplications.scala @@ -283,12 +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) - if (isJava) translateParameterized(defn.RepeatedParamClass, defn.ArrayClass) - else translateParameterized(defn.RepeatedParamClass, defn.SeqClass) + def underlyingIfRepeated(isJava: Boolean)(implicit ctx: Context): Type = + if (self.isRepeatedParam) { + val seqClass = if(isJava) defn.ArrayClass else defn.SeqClass + translateParameterized(defn.RepeatedParamClass, seqClass) + } else self - } /** If this is an encoding of a (partially) applied type, return its arguments, * otherwise return Nil. |