summaryrefslogtreecommitdiff
path: root/test/files/run
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-06-03 17:42:15 -0700
committerPaul Phillips <paulp@improving.org>2013-06-03 17:42:15 -0700
commit1472dadd03496aa89624c81ded01edeb71420cc3 (patch)
tree9d25317ecd880de24c8a4218c88320813e855132 /test/files/run
parentf89f2d969fa0ed0a6bf036a1f6a9cad8267a7265 (diff)
parentd2faeb9ae60389668f1b5f45eb91c73127401e40 (diff)
downloadscala-1472dadd03496aa89624c81ded01edeb71420cc3.tar.gz
scala-1472dadd03496aa89624c81ded01edeb71420cc3.tar.bz2
scala-1472dadd03496aa89624c81ded01edeb71420cc3.zip
Merge pull request #2609 from retronym/ticket/7507
SI-7507 Fix lookup of private[this] member in presence of self type.
Diffstat (limited to 'test/files/run')
-rw-r--r--test/files/run/t7507.scala31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/files/run/t7507.scala b/test/files/run/t7507.scala
new file mode 100644
index 0000000000..6c1959ddac
--- /dev/null
+++ b/test/files/run/t7507.scala
@@ -0,0 +1,31 @@
+trait Cake extends Slice
+
+// Minimization
+trait Slice { self: Cake => // must have self type that extends `Slice`
+ private[this] val bippy = () // must be private[this]
+ locally(bippy)
+}
+
+// Originally reported bug:
+trait Cake1 extends Slice1
+trait Slice1 { self: Cake1 =>
+ import java.lang.String // any import will do!
+ val Tuple2(x, y) = ((1, 2))
+}
+
+
+// Nesting
+trait Cake3 extends Outer.Slice3
+
+// Minimization
+object Outer {
+ private[this] val bippy = ()
+ trait Slice3 { self: Cake3 =>
+ locally(bippy)
+ }
+}
+
+object Test extends App {
+ val s1 = new Cake1 {}
+ assert((s1.x, s1.y) == (1, 2), (s1.x, s1.y))
+}