summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/files/run/t6733.check27
-rw-r--r--test/files/run/t6733.scala35
2 files changed, 62 insertions, 0 deletions
diff --git a/test/files/run/t6733.check b/test/files/run/t6733.check
new file mode 100644
index 0000000000..aeb595fbfd
--- /dev/null
+++ b/test/files/run/t6733.check
@@ -0,0 +1,27 @@
+method $init$: isPrivateThis = false, isProtectedThis = false
+value pri1a: isPrivateThis = true, isProtectedThis = false
+method pri2a: isPrivateThis = true, isProtectedThis = false
+variable pri3a: isPrivateThis = true, isProtectedThis = false
+value pri4a: isPrivateThis = true, isProtectedThis = false
+lazy value pri4a: isPrivateThis = true, isProtectedThis = false
+type Pri5a: isPrivateThis = true, isProtectedThis = false
+class Pri6: isPrivateThis = true, isProtectedThis = false
+trait Pri7: isPrivateThis = true, isProtectedThis = false
+object Pri8: isPrivateThis = true, isProtectedThis = false
+value pro1a: isPrivateThis = false, isProtectedThis = true
+value pro1a: isPrivateThis = true, isProtectedThis = false
+value pro1b: isPrivateThis = false, isProtectedThis = true
+method pro2a: isPrivateThis = false, isProtectedThis = true
+method pro2b: isPrivateThis = false, isProtectedThis = true
+method pro3a: isPrivateThis = false, isProtectedThis = true
+method pro3a_=: isPrivateThis = false, isProtectedThis = true
+variable pro3a: isPrivateThis = true, isProtectedThis = false
+method pro3b: isPrivateThis = false, isProtectedThis = true
+method pro3b_=: isPrivateThis = false, isProtectedThis = true
+value pro4a: isPrivateThis = false, isProtectedThis = true
+lazy value pro4a: isPrivateThis = true, isProtectedThis = false
+type Pro5a: isPrivateThis = false, isProtectedThis = true
+type Pro5b: isPrivateThis = false, isProtectedThis = true
+class Pro6: isPrivateThis = false, isProtectedThis = true
+trait Pro7: isPrivateThis = false, isProtectedThis = true
+object Pro8: isPrivateThis = false, isProtectedThis = true
diff --git a/test/files/run/t6733.scala b/test/files/run/t6733.scala
new file mode 100644
index 0000000000..525b276811
--- /dev/null
+++ b/test/files/run/t6733.scala
@@ -0,0 +1,35 @@
+import scala.reflect.runtime.universe._
+
+trait Foo {
+ private[this] val pri1a = 0
+ // private[this] val pri1b: Int
+ private[this] def pri2a = 1
+ // private[this] def pri2b: Int
+ private[this] var pri3a = 0
+ // private[this] var pri3b: Int
+ private[this] lazy val pri4a = 0
+ // private[this] lazy val pri4b: Int
+ private[this] type Pri5a = Int
+ // private[this] type Pri5b <: Int
+ private[this] class Pri6
+ private[this] trait Pri7
+ private[this] object Pri8
+
+ protected[this] val pro1a = 0
+ protected[this] val pro1b: Int
+ protected[this] def pro2a = 1
+ protected[this] def pro2b: Int
+ protected[this] var pro3a = 0
+ protected[this] var pro3b: Int
+ protected[this] lazy val pro4a = 0
+ // protected[this] lazy val pro4b: Int
+ protected[this] type Pro5a = Int
+ protected[this] type Pro5b <: Int
+ protected[this] class Pro6
+ protected[this] trait Pro7
+ protected[this] object Pro8
+}
+
+object Test extends App {
+ typeOf[Foo].declarations.sorted.foreach(m => println(s"$m: isPrivateThis = ${m.isPrivateThis}, isProtectedThis = ${m.isProtectedThis}"))
+} \ No newline at end of file