summaryrefslogtreecommitdiff
path: root/test/files/pos/t8111.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2014-01-12 09:25:57 -0800
committerJason Zaugg <jzaugg@gmail.com>2014-01-12 09:25:57 -0800
commitd5801b9eee7df49894c05dea430a56190cae2112 (patch)
treed676cb68db2a612075972c975554503bbffd9cdc /test/files/pos/t8111.scala
parenta8122413c0cf2e51cdfd32c0450b91910f8a8cc2 (diff)
parentc91d373a78f0c503ddc635bce1974c1b58008219 (diff)
downloadscala-2.10.4-RC2.tar.gz
scala-2.10.4-RC2.tar.bz2
scala-2.10.4-RC2.zip
Merge pull request #3328 from retronym/ticket/8111v2.10.4-RC2
Repair symbol owners after abandoned named-/default-args
Diffstat (limited to 'test/files/pos/t8111.scala')
-rw-r--r--test/files/pos/t8111.scala24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/files/pos/t8111.scala b/test/files/pos/t8111.scala
new file mode 100644
index 0000000000..0d63a16ba4
--- /dev/null
+++ b/test/files/pos/t8111.scala
@@ -0,0 +1,24 @@
+trait T {
+
+ def crashy(ma: Any) {
+ // okay
+ val f1 = (u: Unit) => ma
+ foo(f1)()
+ foo((u: Unit) => ma)
+ foo(0, (u: Any) => ma) apply ()
+
+ // crash due to side effects on the onwer of the symbol in the
+ // qualifier or arguments of the application during an abandoned
+ // names/defaults transform. The code type checkes because of
+ // autp-tupling which promotes and empty parmater list to `(): Unit`
+ foo((u: Any) => ma)()
+
+ {{(u: Any) => ma}; this}.foo(0)()
+
+ foo({def foo = ma; 0})()
+
+ {def foo = ma; this}.foo(0)()
+ }
+
+ def foo(f: Any): Any => Any
+}