From 31ab8804d611343eb3cf35e2c1b929d5b65a946e Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Thu, 16 Mar 2017 17:07:10 +0100 Subject: Harmonize paramTypes and paramBounds MethodTypes have paramTypes whereas PolyTypes have paramBounds. We now harmonize by alling both paramInfos, and parameterizing types that will become common to both. --- compiler/src/dotty/tools/dotc/core/TypeErasure.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'compiler/src/dotty/tools/dotc/core/TypeErasure.scala') diff --git a/compiler/src/dotty/tools/dotc/core/TypeErasure.scala b/compiler/src/dotty/tools/dotc/core/TypeErasure.scala index fe3396fcb..b716318c1 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeErasure.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeErasure.scala @@ -55,7 +55,7 @@ object TypeErasure { case ThisType(tref) => isErasedType(tref) case tp: MethodType => - tp.paramTypes.forall(isErasedType) && isErasedType(tp.resultType) + tp.paramInfos.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 | SuperType(_, _) => @@ -186,7 +186,7 @@ object TypeErasure { case einfo: MethodType => if (sym.isGetter && einfo.resultType.isRef(defn.UnitClass)) MethodType(Nil, defn.BoxedUnitType) - else if (sym.isAnonymousFunction && einfo.paramTypes.length > MaxImplementedFunctionArity) + else if (sym.isAnonymousFunction && einfo.paramInfos.length > MaxImplementedFunctionArity) MethodType(nme.ALLARGS :: Nil, JavaArrayType(defn.ObjectType) :: Nil, einfo.resultType) else einfo @@ -382,10 +382,10 @@ class TypeErasure(isJava: Boolean, semiEraseVCs: Boolean, isConstructor: Boolean case tp: MethodType => def paramErasure(tpToErase: Type) = erasureFn(tp.isJava, semiEraseVCs, isConstructor, wildcardOK)(tpToErase) - val formals = tp.paramTypes.mapConserve(paramErasure) + val formals = tp.paramInfos.mapConserve(paramErasure) eraseResult(tp.resultType) match { case rt: MethodType => - tp.derivedMethodType(tp.paramNames ++ rt.paramNames, formals ++ rt.paramTypes, rt.resultType) + tp.derivedMethodType(tp.paramNames ++ rt.paramNames, formals ++ rt.paramInfos, rt.resultType) case rt => tp.derivedMethodType(tp.paramNames, formals, rt) } -- cgit v1.2.3