diff options
author | Martin Odersky <odersky@gmail.com> | 2016-10-05 16:09:17 +0200 |
---|---|---|
committer | Guillaume Martres <smarter@ubuntu.com> | 2016-10-12 03:36:57 +0200 |
commit | bafc0a397e28c6e46619f413c9a5648026eac303 (patch) | |
tree | 51207f7e43beb19ced1260bce99b85977b155709 /src/dotty/tools/dotc/core/TypeErasure.scala | |
parent | 8897b46fd41437c8ff1a91fad4a58ed452c3c35c (diff) | |
download | dotty-bafc0a397e28c6e46619f413c9a5648026eac303.tar.gz dotty-bafc0a397e28c6e46619f413c9a5648026eac303.tar.bz2 dotty-bafc0a397e28c6e46619f413c9a5648026eac303.zip |
Harmonize PolyType and TypeLambda
Let them inherit the same traits and push as much
functionality as possibly into the common superclass
GenericType.
Diffstat (limited to 'src/dotty/tools/dotc/core/TypeErasure.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/TypeErasure.scala | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/core/TypeErasure.scala b/src/dotty/tools/dotc/core/TypeErasure.scala index 1a7342a12..bd1b9b1d3 100644 --- a/src/dotty/tools/dotc/core/TypeErasure.scala +++ b/src/dotty/tools/dotc/core/TypeErasure.scala @@ -169,7 +169,7 @@ object TypeErasure { val erase = erasureFn(isJava, semiEraseVCs, sym.isConstructor, wildcardOK = false) def eraseParamBounds(tp: PolyType): Type = - tp.derivedPolyType( + tp.derivedGenericType( tp.paramNames, tp.paramNames map (Function.const(TypeBounds.upper(defn.ObjectType))), tp.resultType) if (defn.isPolymorphicAfterErasure(sym)) eraseParamBounds(sym.info.asInstanceOf[PolyType]) @@ -356,8 +356,6 @@ class TypeErasure(isJava: Boolean, semiEraseVCs: Boolean, isConstructor: Boolean SuperType(this(thistpe), this(supertpe)) case ExprType(rt) => defn.FunctionClass(0).typeRef - case tp: TypeProxy => - this(tp.underlying) case AndType(tp1, tp2) => erasedGlb(this(tp1), this(tp2), isJava) case OrType(tp1, tp2) => @@ -398,6 +396,8 @@ class TypeErasure(isJava: Boolean, semiEraseVCs: Boolean, isConstructor: Boolean tp case tp: WildcardType if wildcardOK => tp + case tp: TypeProxy => + this(tp.underlying) } private def eraseArray(tp: RefinedType)(implicit ctx: Context) = { |