diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2014-01-15 13:42:58 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2014-01-15 13:47:14 +0100 |
commit | 8642a50da8c0d0eb1e3001fb56426e8c1ef122f3 (patch) | |
tree | d1c294b85c82abef8cc181d9641afe6d08b07b4b /src/compiler | |
parent | e089cafb5fd02e2457bafde3252da3a771d3180e (diff) | |
download | scala-8642a50da8c0d0eb1e3001fb56426e8c1ef122f3.tar.gz scala-8642a50da8c0d0eb1e3001fb56426e8c1ef122f3.tar.bz2 scala-8642a50da8c0d0eb1e3001fb56426e8c1ef122f3.zip |
SI-8132 Fix false "overrides nothing" for case class protected param
Case class parameters that are less-than-public have an accessor
method created. In the enclosed test, we saw:
case class G extends AnyRef with T with Product with Serializable {
override <synthetic> <stable> <caseaccessor> def s$1: String = G.this.s;
<caseaccessor> <paramaccessor> private[this] val s: String = _;
override <stable> <accessor> <paramaccessor> protected def s: String = G.this.s;
...
}
This commit removes the OVERRIDE flag from the accessor method,
which avoids the spurious "overrides nothing" error.
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala | 2 |
1 files changed, 1 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`? |