diff options
author | Martin Odersky <odersky@gmail.com> | 2014-12-05 16:29:05 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-12-05 16:29:13 +0100 |
commit | 0b82c376e771e493e4d595bf22b478790f7b5166 (patch) | |
tree | fd476318fd38756d367eb5659ccfac8210f92880 /src/dotty/tools/dotc/core/TypeApplications.scala | |
parent | 042cee21d2d12445d728b19b896a75ba4a4a7bd9 (diff) | |
download | dotty-0b82c376e771e493e4d595bf22b478790f7b5166.tar.gz dotty-0b82c376e771e493e4d595bf22b478790f7b5166.tar.bz2 dotty-0b82c376e771e493e4d595bf22b478790f7b5166.zip |
Better typing of seqLiteral in erasure.
Fixed two problems with previous commit.
Diffstat (limited to 'src/dotty/tools/dotc/core/TypeApplications.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/TypeApplications.scala | 7 |
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 * |