diff options
author | Martin Odersky <odersky@gmail.com> | 2017-03-16 15:15:28 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2017-04-06 13:15:27 +0200 |
commit | c024a6037f3dd7e7458d936566cd4b653b8b7545 (patch) | |
tree | aae9b2e9b332fc166a04f1b29f1ff4e62fdd6216 /compiler/src/dotty/tools/dotc/transform | |
parent | 549bd812684e6f269610234ddefe8054dfb42746 (diff) | |
download | dotty-c024a6037f3dd7e7458d936566cd4b653b8b7545.tar.gz dotty-c024a6037f3dd7e7458d936566cd4b653b8b7545.tar.bz2 dotty-c024a6037f3dd7e7458d936566cd4b653b8b7545.zip |
Break out functionality from MethodType
and generalize MethodParam to ParamRef, and
TypeParamInfo to ParamInfo
Diffstat (limited to 'compiler/src/dotty/tools/dotc/transform')
-rw-r--r-- | compiler/src/dotty/tools/dotc/transform/FullParameterization.scala | 2 | ||||
-rw-r--r-- | compiler/src/dotty/tools/dotc/transform/SuperAccessors.scala | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/compiler/src/dotty/tools/dotc/transform/FullParameterization.scala b/compiler/src/dotty/tools/dotc/transform/FullParameterization.scala index cdc28b23f..7fb9ba302 100644 --- a/compiler/src/dotty/tools/dotc/transform/FullParameterization.scala +++ b/compiler/src/dotty/tools/dotc/transform/FullParameterization.scala @@ -107,7 +107,7 @@ trait FullParameterization { val firstArgType = if (liftThisType) thisParamType & clazz.thisType else thisParamType MethodType(nme.SELF :: Nil)( mt => firstArgType :: Nil, - mt => mapClassParams(origResult).substThisUnlessStatic(clazz, MethodParam(mt, 0))) + mt => mapClassParams(origResult).substThisUnlessStatic(clazz, mt.newParamRef(0))) } /** Replace class type parameters by the added type parameters of the polytype `pt` */ diff --git a/compiler/src/dotty/tools/dotc/transform/SuperAccessors.scala b/compiler/src/dotty/tools/dotc/transform/SuperAccessors.scala index 3c11827fc..8907cc4dd 100644 --- a/compiler/src/dotty/tools/dotc/transform/SuperAccessors.scala +++ b/compiler/src/dotty/tools/dotc/transform/SuperAccessors.scala @@ -180,7 +180,7 @@ class SuperAccessors(thisTransformer: DenotTransformer) { case tpe: PolyType => tpe.derivedPolyType(tpe.paramNames, tpe.paramBounds, accTypeOf(tpe.resultType)) case _ => - MethodType(receiverType :: Nil)(mt => tpe.substThis(sym.owner.asClass, MethodParam(mt, 0))) + MethodType(receiverType :: Nil)(mt => tpe.substThis(sym.owner.asClass, mt.newParamRef(0))) } accTypeOf(sym.info) } @@ -232,7 +232,7 @@ class SuperAccessors(thisTransformer: DenotTransformer) { case tpe: PolyType => tpe.derivedPolyType(tpe.paramNames, tpe.paramBounds, accTypeOf(tpe.resultType)) case _ => - MethodType(receiverType :: Nil)(mt => tpe.substThis(sym.owner.asClass, MethodParam(mt, 0))) + MethodType(receiverType :: Nil)(mt => tpe.substThis(sym.owner.asClass, mt.newParamRef(0))) } val accType = accTypeOf(sym.info) val protectedAccessor = clazz.info.decl(accName).suchThat(_.signature == accType.signature).symbol orElse { |