aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/transform/SuperAccessors.scala
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/src/dotty/tools/dotc/transform/SuperAccessors.scala')
-rw-r--r--compiler/src/dotty/tools/dotc/transform/SuperAccessors.scala10
1 files changed, 6 insertions, 4 deletions
diff --git a/compiler/src/dotty/tools/dotc/transform/SuperAccessors.scala b/compiler/src/dotty/tools/dotc/transform/SuperAccessors.scala
index bae1b897e..583834fb3 100644
--- a/compiler/src/dotty/tools/dotc/transform/SuperAccessors.scala
+++ b/compiler/src/dotty/tools/dotc/transform/SuperAccessors.scala
@@ -11,6 +11,7 @@ import Types._, Contexts._, Constants._, Names._, NameOps._, Flags._, DenotTrans
import SymDenotations._, Symbols._, StdNames._, Annotations._, Trees._, Scopes._, Denotations._
import util.Positions._
import Decorators._
+import NameKinds.{ProtectedAccessorName, ProtectedSetterName}
import Symbols._, TypeUtils._
/** This class performs the following functions:
@@ -168,7 +169,7 @@ class SuperAccessors(thisTransformer: DenotTransformer) {
assert(clazz.exists, sym)
ctx.debuglog("Decided for host class: " + clazz)
- val accName = sym.name.protectedAccessorName
+ val accName = ProtectedAccessorName(sym.name)
// if the result type depends on the this type of an enclosing class, the accessor
// has to take an object of exactly this type, otherwise it's more general
@@ -206,7 +207,8 @@ class SuperAccessors(thisTransformer: DenotTransformer) {
}
def isProtectedAccessor(tree: Tree)(implicit ctx: Context): Boolean = tree match {
- case Apply(TypeApply(Select(_, name), _), qual :: Nil) => name.isProtectedAccessorName
+ case Apply(TypeApply(Select(_, name), _), qual :: Nil) =>
+ name.is(ProtectedAccessorName) || name.is(ProtectedSetterName)
case _ => false
}
@@ -221,7 +223,7 @@ class SuperAccessors(thisTransformer: DenotTransformer) {
assert(clazz.exists, sym)
ctx.debuglog("Decided for host class: " + clazz)
- val accName = sym.name.protectedAccessorName
+ val accName = ProtectedAccessorName(sym.name)
// if the result type depends on the this type of an enclosing class, the accessor
// has to take an object of exactly this type, otherwise it's more general
@@ -265,7 +267,7 @@ class SuperAccessors(thisTransformer: DenotTransformer) {
assert(clazz.exists, field)
ctx.debuglog("Decided for host class: " + clazz)
- val accName = field.name.protectedSetterName
+ val accName = ProtectedSetterName(field.name)
val accType = MethodType(clazz.classInfo.selfType :: field.info :: Nil, defn.UnitType)
val protectedAccessor = clazz.info.decl(accName).symbol orElse {
val newAcc = ctx.newSymbol(