summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala2
-rw-r--r--test/files/pos/t8132.scala5
2 files changed, 6 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala b/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala
index f0252251f7..9516f94135 100644
--- a/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala
@@ -380,7 +380,7 @@ trait SyntheticMethods extends ast.TreeDSL {
val original = ddef.symbol
val newAcc = deriveMethod(ddef.symbol, name => context.unit.freshTermName(name + "$")) { newAcc =>
newAcc.makePublic
- newAcc resetFlag (ACCESSOR | PARAMACCESSOR)
+ newAcc resetFlag (ACCESSOR | PARAMACCESSOR | OVERRIDE)
ddef.rhs.duplicate
}
// TODO: shouldn't the next line be: `original resetFlag CASEACCESSOR`?
diff --git a/test/files/pos/t8132.scala b/test/files/pos/t8132.scala
new file mode 100644
index 0000000000..b4d6fd9441
--- /dev/null
+++ b/test/files/pos/t8132.scala
@@ -0,0 +1,5 @@
+trait T {
+ protected def s: String
+}
+
+case class G(override protected val s: String) extends T