From 3c2a34e8c73521e3a847483023cf8aede0079670 Mon Sep 17 00:00:00 2001 From: odersky Date: Thu, 4 Mar 2010 14:06:18 +0000 Subject: [PATCH] Closes #3118. review by extempore git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@21064 5e8d7ff9-d8ef-0310-90f0-a4852d11357a --- src/compiler/scala/tools/nsc/symtab/Flags.scala | 2 +- test/files/neg/t3118.check | 7 +++++++ test/files/neg/t3118.scala | 8 ++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 test/files/neg/t3118.check create mode 100644 test/files/neg/t3118.scala diff --git a/src/compiler/scala/tools/nsc/symtab/Flags.scala b/src/compiler/scala/tools/nsc/symtab/Flags.scala index 787887115..488b8be73 100644 --- a/src/compiler/scala/tools/nsc/symtab/Flags.scala +++ b/src/compiler/scala/tools/nsc/symtab/Flags.scala @@ -53,7 +53,7 @@ object Flags extends reflect.generic.Flags { final val FieldFlags: Long = MUTABLE | CASEACCESSOR | PARAMACCESSOR | STATIC | FINAL | PRESUPER | LAZY - final val AccessFlags: Long = PRIVATE | PROTECTED + final val AccessFlags: Long = PRIVATE | PROTECTED | LOCAL final val VARIANCES = COVARIANT | CONTRAVARIANT final val ConstrFlags: Long = JAVA diff --git a/test/files/neg/t3118.check b/test/files/neg/t3118.check new file mode 100644 index 000000000..da00f1c33 --- /dev/null +++ b/test/files/neg/t3118.check @@ -0,0 +1,7 @@ +t3118.scala:6: error: value C is not a member of O1 + println(x.C()) // should not be accessible + ^ +t3118.scala:7: error: type C is not a member of O1 + println(new x.C) // is correctly not accessible + ^ +two errors found diff --git a/test/files/neg/t3118.scala b/test/files/neg/t3118.scala new file mode 100644 index 000000000..75f3b8f50 --- /dev/null +++ b/test/files/neg/t3118.scala @@ -0,0 +1,8 @@ +class O1 { + private[this] case class C() + + val x = new O1 + + println(x.C()) // should not be accessible + println(new x.C) // is correctly not accessible +}