diff options
author | Martin Odersky <odersky@gmail.com> | 2014-12-03 18:19:44 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-12-03 18:19:44 +0100 |
commit | 95ffe46b6c79ddef3536619cff23134ac8bab010 (patch) | |
tree | e32aac91342a28e7a81750d62a1e81ba9fcec6c8 /src | |
parent | 3ee4a25966ead5410351faf40f3aa5745296a3d4 (diff) | |
download | dotty-95ffe46b6c79ddef3536619cff23134ac8bab010.tar.gz dotty-95ffe46b6c79ddef3536619cff23134ac8bab010.tar.bz2 dotty-95ffe46b6c79ddef3536619cff23134ac8bab010.zip |
made ArrayType constructor phase aware
Avoid to create ArrayTypes after erase.
Note that the *extractor* does not recognize JavaArrayTypes as
ArrayTypes. Doing so would create an infinite loop in sigName.
Generally, we do not want to ppaper over the difference when analysing
types.
Diffstat (limited to 'src')
-rw-r--r-- | src/dotty/tools/dotc/core/Definitions.scala | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/Definitions.scala b/src/dotty/tools/dotc/core/Definitions.scala index 20dd899f1..14baa0b96 100644 --- a/src/dotty/tools/dotc/core/Definitions.scala +++ b/src/dotty/tools/dotc/core/Definitions.scala @@ -394,7 +394,8 @@ class Definitions { object ArrayType { def apply(elem: Type)(implicit ctx: Context) = - ArrayClass.typeRef.appliedTo(elem :: Nil) + if (ctx.erasedTypes) JavaArrayType(elem) + else ArrayClass.typeRef.appliedTo(elem :: Nil) def unapply(tp: Type)(implicit ctx: Context) = tp.dealias match { case at: RefinedType if (at isRef ArrayClass) && at.argInfos.length == 1 => Some(at.argInfos.head) case _ => None |