diff options
author | Paul Phillips <paulp@improving.org> | 2013-03-12 19:19:20 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2013-03-12 19:19:20 -0700 |
commit | c964643604ea9e431f4076069fbbc18953d3c1c9 (patch) | |
tree | e74367853bad0b03814d4e62c3dace4b2716664d /src/compiler | |
parent | 2f38bb8e5c69af0db63e05da78301dda916fad6f (diff) | |
parent | 34faa0d073a8613deebffe7605fd8a5e9a93afbc (diff) | |
download | scala-c964643604ea9e431f4076069fbbc18953d3c1c9.tar.gz scala-c964643604ea9e431f4076069fbbc18953d3c1c9.tar.bz2 scala-c964643604ea9e431f4076069fbbc18953d3c1c9.zip |
Merge pull request #2236 from retronym/ticket/6601-2
SI-6601 Close access loophole for value class constructors
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala | 2 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/RefChecks.scala | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala b/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala index 140be0e17b..9b33ae8ba1 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala @@ -528,7 +528,7 @@ abstract class Pickler extends SubComponent { private def writeSymInfo(sym: Symbol) { writeRef(sym.name) writeRef(localizedOwner(sym)) - writeLongNat((rawToPickledFlags(sym.flags & PickledFlags))) + writeLongNat((rawToPickledFlags(sym.rawflags & PickledFlags))) if (sym.hasAccessBoundary) writeRef(sym.privateWithin) writeRef(sym.info) } diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala index b7221a78ec..b32fc6b977 100644 --- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala +++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala @@ -1553,6 +1553,8 @@ abstract class RefChecks extends InfoTransform with scala.reflect.internal.trans val bridges = addVarargBridges(currentOwner) checkAllOverrides(currentOwner) checkAnyValSubclass(currentOwner) + if (currentOwner.isDerivedValueClass) + currentOwner.primaryConstructor makeNotPrivate NoSymbol // SI-6601, must be done *after* pickler! if (bridges.nonEmpty) deriveTemplate(tree)(_ ::: bridges) else tree case dc@TypeTreeWithDeferredRefCheck() => abort("adapt should have turned dc: TypeTreeWithDeferredRefCheck into tpt: TypeTree, with tpt.original == dc") |