From 0d7223ab0c61fd7d0a864f15031c34f0bb946e40 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 15 Jul 2014 15:48:25 +0200 Subject: Fixed underlyingIfRepeated. ... and moved to TypeApplications. --- src/dotty/tools/dotc/core/TypeApplications.scala | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/dotty/tools/dotc/core/TypeApplications.scala') 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. -- cgit v1.2.3