aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/TypeErasure.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-09-10 06:48:42 +0200
committerMartin Odersky <odersky@gmail.com>2014-09-10 06:48:50 +0200
commit81b27b159ac7e0cc7bc9b63aa9f11ea274ec4f08 (patch)
treed3d6d33c512636bec917d92d41f66654d9e1415b /src/dotty/tools/dotc/TypeErasure.scala
parent5cc99d4f09b986748e9250a58954c2f097664b66 (diff)
downloaddotty-81b27b159ac7e0cc7bc9b63aa9f11ea274ec4f08.tar.gz
dotty-81b27b159ac7e0cc7bc9b63aa9f11ea274ec4f08.tar.bz2
dotty-81b27b159ac7e0cc7bc9b63aa9f11ea274ec4f08.zip
Keep SuperTypes around after erasure.
The reason is that otherwise the non-private member super.x gets merged with the private member this.x and that causes a double binding violation.
Diffstat (limited to 'src/dotty/tools/dotc/TypeErasure.scala')
-rw-r--r--src/dotty/tools/dotc/TypeErasure.scala5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/TypeErasure.scala b/src/dotty/tools/dotc/TypeErasure.scala
index d46c64006..1212c9e4d 100644
--- a/src/dotty/tools/dotc/TypeErasure.scala
+++ b/src/dotty/tools/dotc/TypeErasure.scala
@@ -14,6 +14,7 @@ import util.DotClass
* AnnotatedType
* MethodType
* ThisType
+ * SuperType
* ClassInfo (NoPrefix, ...)
* NoType
* NoPrefix
@@ -43,7 +44,7 @@ object TypeErasure {
tp.paramTypes.forall(isErasedType) && isErasedType(tp.resultType)
case tp @ ClassInfo(pre, _, parents, decls, _) =>
isErasedType(pre) && parents.forall(isErasedType) //&& decls.forall(sym => isErasedType(sym.info)) && isErasedType(tp.selfType)
- case NoType | NoPrefix | WildcardType | ErrorType =>
+ case NoType | NoPrefix | WildcardType | ErrorType | SuperType(_, _) =>
true
case _ =>
false
@@ -237,7 +238,7 @@ class TypeErasure(isJava: Boolean, isSemi: Boolean, isConstructor: Boolean, wild
case tp: TermRef =>
assert(tp.symbol.exists, tp)
TermRef(NoPrefix, tp.symbol.asTerm)
- case ThisType(_) =>
+ case ThisType(_) | SuperType(_, _) =>
tp
case ExprType(rt) =>
MethodType(Nil, Nil, this(rt))