summaryrefslogtreecommitdiff
path: root/test/files/run/t7747-repl.scala
diff options
context:
space:
mode:
authorPrashant Sharma <prashant.s@imaginea.com>2015-05-06 16:26:03 +0530
committerJason Zaugg <jzaugg@gmail.com>2015-05-26 18:46:37 +1000
commita3bb887e0200cf47a1fa2382a18948b3c553cf26 (patch)
tree8a01ed0ffec7fea0b8bb499bb1a1964d260fc7f3 /test/files/run/t7747-repl.scala
parente12ba55589192fc3a3cc7b441569fbcabc04dd33 (diff)
downloadscala-a3bb887e0200cf47a1fa2382a18948b3c553cf26.tar.gz
scala-a3bb887e0200cf47a1fa2382a18948b3c553cf26.tar.bz2
scala-a3bb887e0200cf47a1fa2382a18948b3c553cf26.zip
SI-7747 Make REPL wrappers serialization friendly
Spark has been shipping a forked version of our REPL for sometime. We have been trying to fold the patches back into the mainline so they can defork. This is the last outstanding issue. Consider this REPL session: ``` scala> val x = StdIn.readInt scala> class A(a: Int) scala> serializedAndExecuteRemotely { () => new A(x) } ``` As shown by the enclosed test, the REPL, even with the Spark friendly option `-Yrepl-class-based`, will re-initialize `x` on the remote system. This test simulates this by running a REPL session, and then deserializing the resulting closure into a fresh classloader based on the class files generated by that session. Before this patch, it printed "evaluating x" twice. This is based on the Spark change described: https://github.com/mesos/spark/pull/535#discussion_r3541925 A followup commit will avoid the `val lineN$read = ` part if we import classes or type aliases only. [Original commit from Prashant Sharma, test case from Jason Zaugg]
Diffstat (limited to 'test/files/run/t7747-repl.scala')
-rw-r--r--test/files/run/t7747-repl.scala2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/files/run/t7747-repl.scala b/test/files/run/t7747-repl.scala
index 0e64210460..a681eb8851 100644
--- a/test/files/run/t7747-repl.scala
+++ b/test/files/run/t7747-repl.scala
@@ -65,5 +65,7 @@ object Test extends ReplTest {
|case class PuppyPups()
|case class Bingo()
|List(BippyBups(), PuppyPups(), Bingo()) // show
+ |:power
+ |intp.lastRequest
|""".stripMargin
}