summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/files/run/t6309.check1
-rw-r--r--test/files/run/t6309.scala16
2 files changed, 17 insertions, 0 deletions
diff --git a/test/files/run/t6309.check b/test/files/run/t6309.check
new file mode 100644
index 0000000000..7f8f011eb7
--- /dev/null
+++ b/test/files/run/t6309.check
@@ -0,0 +1 @@
+7
diff --git a/test/files/run/t6309.scala b/test/files/run/t6309.scala
new file mode 100644
index 0000000000..7bbca63c2a
--- /dev/null
+++ b/test/files/run/t6309.scala
@@ -0,0 +1,16 @@
+trait A {
+ def a: Int
+}
+
+object Test {
+ def f(a: Int) = new {
+ //private val b = a
+ private[this] val b = a // crashes, sorry scalac
+ } with A {
+ def a = b
+ }
+
+ def main(args: Array[String]) {
+ println(f(7).a)
+ }
+}