aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDmitry Petrashko <dmitry.petrashko@gmail.com>2015-12-20 17:12:13 +0100
committerMartin Odersky <odersky@gmail.com>2015-12-21 11:25:57 +0100
commit5a8675b76e1b7bed1b21cfdde211ffd89063eb9a (patch)
tree57aa3524045fbb2ba03345dbeb9c793303703fec /src
parent513312450fddff94371f6ca0afd2524e2a17eed9 (diff)
downloaddotty-5a8675b76e1b7bed1b21cfdde211ffd89063eb9a.tar.gz
dotty-5a8675b76e1b7bed1b21cfdde211ffd89063eb9a.tar.bz2
dotty-5a8675b76e1b7bed1b21cfdde211ffd89063eb9a.zip
Fix erasure of raw arrays
Diffstat (limited to 'src')
-rw-r--r--src/dotty/tools/dotc/core/TypeErasure.scala1
-rw-r--r--src/dotty/tools/dotc/transform/Erasure.scala2
2 files changed, 2 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/TypeErasure.scala b/src/dotty/tools/dotc/core/TypeErasure.scala
index b6d7e491d..e4f91914b 100644
--- a/src/dotty/tools/dotc/core/TypeErasure.scala
+++ b/src/dotty/tools/dotc/core/TypeErasure.scala
@@ -321,6 +321,7 @@ class TypeErasure(isJava: Boolean, semiEraseVCs: Boolean, isConstructor: Boolean
val sym = tp.symbol
if (!sym.isClass) this(tp.info)
else if (semiEraseVCs && isDerivedValueClass(sym)) eraseDerivedValueClassRef(tp)
+ else if (sym == defn.ArrayClass) apply(tp.appliedTo(TypeBounds.empty)) // i966 shows that we can hit a raw Array type.
else eraseNormalClassRef(tp)
case tp: RefinedType =>
val parent = tp.parent
diff --git a/src/dotty/tools/dotc/transform/Erasure.scala b/src/dotty/tools/dotc/transform/Erasure.scala
index 1b9b898f2..b3979c524 100644
--- a/src/dotty/tools/dotc/transform/Erasure.scala
+++ b/src/dotty/tools/dotc/transform/Erasure.scala
@@ -109,7 +109,7 @@ class Erasure extends Phase with DenotTransformer { thisTransformer =>
}
def assertErased(tp: Type, tree: tpd.Tree = tpd.EmptyTree)(implicit ctx: Context): Unit =
- assert(isErasedType(tp), i"The type $tp - ${tp.toString} of class ${tp.getClass} of tree $tree : ${tree.tpe} / ${tree.getClass} is illegal after erasure, phase = ${ctx.phase}")
+ assert(isErasedType(tp), i"The type $tp - ${tp.toString} of class ${tp.getClass} of tree $tree : ${tree.tpe} / ${tree.getClass} is illegal after erasure, phase = ${ctx.phase.prev}")
}
object Erasure extends TypeTestsCasts{