summaryrefslogtreecommitdiff
path: root/test/pending/run
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-09-06 16:26:16 +0200
committerJason Zaugg <jzaugg@gmail.com>2013-09-09 23:32:24 +0200
commit292134a4ab5a10052046a722c0b3192b3bfabae7 (patch)
treeaa205b8921b7ae0a228b2c79c45043f38ca5b952 /test/pending/run
parentce98bb437b0f2743c08a654df4110f940458af54 (diff)
downloadscala-292134a4ab5a10052046a722c0b3192b3bfabae7.tar.gz
scala-292134a4ab5a10052046a722c0b3192b3bfabae7.tar.bz2
scala-292134a4ab5a10052046a722c0b3192b3bfabae7.zip
SI-7817 Tests to show the foibles of mkAttributedRef
To `package`, or not `package`, that is the question. This lines marked with !!! get this wrong, and be remedied by the next commit. This problem is culpable for the crash in the enclosed `pending` test.
Diffstat (limited to 'test/pending/run')
-rw-r--r--test/pending/run/t7817.scala31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/pending/run/t7817.scala b/test/pending/run/t7817.scala
new file mode 100644
index 0000000000..905b8aeb09
--- /dev/null
+++ b/test/pending/run/t7817.scala
@@ -0,0 +1,31 @@
+import language.reflectiveCalls
+
+package test {
+ class C1 {
+ object O {
+ def struct(s: {def foo: Any}) = s.foo
+ }
+ }
+ trait T {
+ object O {
+ def struct(s: {def foo: Any}) = s.foo
+ }
+ }
+ object O1 extends T
+
+ object O2 {
+ object O {
+ def struct(s: {def foo: Any}) = s.foo
+ }
+ }
+}
+
+object Test extends App {
+ object fooable { def foo = "foo" }
+ def check(result: Any) = assert(result == "foo", result.toString)
+
+ val s = new test.C1
+ check(s.O.struct(fooable))
+ check(test.O1.O.struct(fooable))
+ check(test.O2.O.struct(fooable))
+}