aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/TypeApplications.scala
diff options
context:
space:
mode:
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 d00b018c8..874928fcc 100644
--- a/src/dotty/tools/dotc/core/TypeApplications.scala
+++ b/src/dotty/tools/dotc/core/TypeApplications.scala
@@ -367,8 +367,11 @@ class TypeApplications(val self: Type) extends AnyVal {
}
/** The element type of a sequence or array */
- def elemType(implicit ctx: Context): Type =
- firstBaseArgInfo(defn.SeqClass) orElse firstBaseArgInfo(defn.ArrayClass)
+ def elemType(implicit ctx: Context): Type = self match {
+ case defn.ArrayType(elemtp) => elemtp
+ case JavaArrayType(elemtp) => elemtp
+ case _ => firstBaseArgInfo(defn.SeqClass)
+ }
/** Given a type alias
*