diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2014-11-02 22:30:08 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2014-11-02 22:30:08 +1000 |
commit | d1a76d5af7faa12ebebea0923812af26c40eebc9 (patch) | |
tree | cfd235e067944568b2a56c9df8a7a61822f371b5 /src | |
parent | b473e7c99b2e2e37b3fdb17af2693bf0ed7a02b2 (diff) | |
parent | 134d97dbf56fe96f0a820c78780dd92e8bf9c5e2 (diff) | |
download | scala-d1a76d5af7faa12ebebea0923812af26c40eebc9.tar.gz scala-d1a76d5af7faa12ebebea0923812af26c40eebc9.tar.bz2 scala-d1a76d5af7faa12ebebea0923812af26c40eebc9.zip |
Merge pull request #4081 from retronym/ticket/8943
SI-8943 Handle non-public case fields in pres. compiler
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Namers.scala | 1 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala index 8bdf5c33ba..a1de5e303b 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala @@ -413,6 +413,7 @@ trait Namers extends MethodSynthesis { if (isRedefinition) { updatePosFlags(existing, tree.pos, tree.mods.flags) setPrivateWithin(tree, existing) + clearRenamedCaseAccessors(existing) existing } else assignAndEnterSymbol(tree) setFlag inConstructorFlag diff --git a/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala b/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala index bedca88974..1daff02c23 100644 --- a/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala +++ b/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala @@ -54,6 +54,9 @@ trait SyntheticMethods extends ast.TreeDSL { /** Does not force the info of `caseclazz` */ final def caseAccessorName(caseclazz: Symbol, paramName: TermName) = (renamedCaseAccessors get caseclazz).fold(paramName)(_(paramName)) + final def clearRenamedCaseAccessors(caseclazz: Symbol): Unit = { + renamedCaseAccessors -= caseclazz + } /** Add the synthetic methods to case classes. */ |